Record Class NexoriAfkDetectionPolicy
java.lang.Object
java.lang.Record
io.github.hyjn.nexori.plugin.api.minigame.NexoriAfkDetectionPolicy
- Record Components:
enabled- whether Nexori's local lightweight AFK detector should run.inactivityTimeoutSeconds- inactivity duration required before Nexori marks a player AFK.
public record NexoriAfkDetectionPolicy(boolean enabled, int inactivityTimeoutSeconds)
extends Record
Public AFK detection policy used by runtime match/player overrides.
defaults() returns local AFK detection disabled with a 30 second inactivity
timeout. Runtime policies may be enabled at match or player scope. Timeout values are
normalized to the supported 5-3600 second range.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionNexoriAfkDetectionPolicy(boolean enabled, int inactivityTimeoutSeconds) Creates an instance of aNexoriAfkDetectionPolicyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic NexoriAfkDetectionPolicydefaults()Returns the default disabled policy used when no runtime override is configured.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theinactivityTimeoutSecondsrecord component.static NexoriAfkDetectionPolicynormalize(NexoriAfkDetectionPolicy policy) Normalizes a nullable policy.Returns this policy with its timeout clamped into the supported range.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_INACTIVITY_TIMEOUT_SECONDS
public static final int DEFAULT_INACTIVITY_TIMEOUT_SECONDS- See Also:
-
MIN_INACTIVITY_TIMEOUT_SECONDS
public static final int MIN_INACTIVITY_TIMEOUT_SECONDS- See Also:
-
MAX_INACTIVITY_TIMEOUT_SECONDS
public static final int MAX_INACTIVITY_TIMEOUT_SECONDS- See Also:
-
-
Constructor Details
-
NexoriAfkDetectionPolicy
public NexoriAfkDetectionPolicy(boolean enabled, int inactivityTimeoutSeconds) Creates an instance of aNexoriAfkDetectionPolicyrecord class.- Parameters:
enabled- the value for theenabledrecord componentinactivityTimeoutSeconds- the value for theinactivityTimeoutSecondsrecord component
-
-
Method Details
-
defaults
Returns the default disabled policy used when no runtime override is configured.- Returns:
- disabled policy with a 30 second normalized timeout.
-
normalize
Normalizes a nullable policy.- Parameters:
policy- policy to normalize, ornullto usedefaults().- Returns:
- a non-null policy with a valid timeout.
-
normalized
Returns this policy with its timeout clamped into the supported range.- Returns:
- normalized policy.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
enabled
-
inactivityTimeoutSeconds
public int inactivityTimeoutSeconds()Returns the value of theinactivityTimeoutSecondsrecord component.- Returns:
- the value of the
inactivityTimeoutSecondsrecord component
-