Class Node
java.lang.Object
com.github.darksoulq.abyssallib.server.permission.Node
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
ConstructorsConstructorDescriptionConstructs a permanent Node with a specific key, defaulting the value totrue.Constructs a permanent Node with a specific key and value.Constructs a Node with a specific key, value, and expiry. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this node to another object based on the key.longGets the expiration timestamp.getKey()Gets the identifier key of this node.booleangetValue()Gets the boolean state of this node.booleanChecks if the current system time has passed the expiration timestamp.inthashCode()Generates a hash code based on the node key.booleanChecks if this node has a set expiration date.
-
Constructor Details
-
Node
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
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
Constructs a permanent Node with a specific key, defaulting the value totrue.- Parameters:
key- The permission or group key.
-
-
Method Details
-
getKey
-
getValue
public boolean getValue()Gets the boolean state of this node.- Returns:
trueif granted/active,falseif denied.
-
getExpiry
public long getExpiry()Gets the expiration timestamp.- Returns:
- The expiry time in milliseconds, or
0Lif permanent.
-
isTemporary
public boolean isTemporary()Checks if this node has a set expiration date.- Returns:
trueif the node is temporary,falseif permanent.
-
hasExpired
public boolean hasExpired()Checks if the current system time has passed the expiration timestamp.- Returns:
trueif temporary and expired,falseotherwise.
-
equals
-
hashCode
-