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 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 a NexoriAfkDetectionPolicy record class.
      Parameters:
      enabled - the value for the enabled record component
      inactivityTimeoutSeconds - the value for the inactivityTimeoutSeconds record component
  • Method Details

    • defaults

      @Nonnull public static NexoriAfkDetectionPolicy defaults()
      Returns the default disabled policy used when no runtime override is configured.
      Returns:
      disabled policy with a 30 second normalized timeout.
    • normalize

      @Nonnull public static NexoriAfkDetectionPolicy normalize(NexoriAfkDetectionPolicy policy)
      Normalizes a nullable policy.
      Parameters:
      policy - policy to normalize, or null to use defaults().
      Returns:
      a non-null policy with a valid timeout.
    • normalized

      @Nonnull public NexoriAfkDetectionPolicy normalized()
      Returns this policy with its timeout clamped into the supported range.
      Returns:
      normalized policy.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • inactivityTimeoutSeconds

      public int inactivityTimeoutSeconds()
      Returns the value of the inactivityTimeoutSeconds record component.
      Returns:
      the value of the inactivityTimeoutSeconds record component