Class Node

java.lang.Object
com.github.darksoulq.abyssallib.server.permission.Node

public class Node extends Object
Represents a specific permission entry or group inheritance entry.

A Node can be permanent or temporary. When used in a PermissionHolder, it determines whether a specific permission string is granted or denied, or whether a group is inherited as a parent.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Node(String key)
    Constructs a permanent Node with a specific key, defaulting the value to true.
    Node(String key, boolean value)
    Constructs a permanent Node with a specific key and value.
    Node(String key, boolean value, long expiry)
    Constructs a Node with a specific key, value, and expiry.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Compares this node to another object based on the key.
    long
    Gets the expiration timestamp.
    Gets the identifier key of this node.
    boolean
    Gets the boolean state of this node.
    boolean
    Checks if the current system time has passed the expiration timestamp.
    int
    Generates a hash code based on the node key.
    boolean
    Checks if this node has a set expiration date.

    Methods inherited from class Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Node

      public Node(String key, boolean value, long expiry)
      Constructs a Node with a specific key, value, and expiry.
      Parameters:
      key - The permission or group key.
      value - The boolean state of the node.
      expiry - The expiration timestamp in milliseconds.
    • Node

      public Node(String key, boolean value)
      Constructs a permanent Node with a specific key and value.
      Parameters:
      key - The permission or group key.
      value - The boolean state of the node.
    • Node

      public Node(String key)
      Constructs a permanent Node with a specific key, defaulting the value to true.
      Parameters:
      key - The permission or group key.
  • Method Details

    • getKey

      public String getKey()
      Gets the identifier key of this node.
      Returns:
      The key string.
    • getValue

      public boolean getValue()
      Gets the boolean state of this node.
      Returns:
      true if granted/active, false if denied.
    • getExpiry

      public long getExpiry()
      Gets the expiration timestamp.
      Returns:
      The expiry time in milliseconds, or 0L if permanent.
    • isTemporary

      public boolean isTemporary()
      Checks if this node has a set expiration date.
      Returns:
      true if the node is temporary, false if permanent.
    • hasExpired

      public boolean hasExpired()
      Checks if the current system time has passed the expiration timestamp.
      Returns:
      true if temporary and expired, false otherwise.
    • equals

      public boolean equals(Object o)
      Compares this node to another object based on the key.
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare.
      Returns:
      true if the keys match.
    • hashCode

      public int hashCode()
      Generates a hash code based on the node key.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.