Interface Node

    • Method Detail

      • getType

        @NonNull NodeType<?> getType()
        Gets the type of the node.
        Returns:
        the node type
      • getValue

        boolean getValue()
        Gets the value of the node.

        A negated setting would result in a value of false.

        Returns:
        the nodes value
      • isNegated

        default boolean isNegated()
        Gets if the node is negated.

        This is the inverse of the value.

        Returns:
        true if the node is negated
      • resolveShorthand

        @NonNull @Unmodifiable Collection<String> resolveShorthand()
        Resolves any shorthand parts of this node and returns the full list of resolved nodes.

        The list will not contain the exact permission itself.

        Returns:
        a list of full nodes
      • hasExpiry

        boolean hasExpiry()
        Gets if this node is assigned temporarily.
        Returns:
        true if this node will expire in the future
      • getExpiry

        @Nullable Instant getExpiry()
        Gets the time when this node will expire.
        Returns:
        the Instant when this node will expire, or null if it doesn't have an expiry time
      • hasExpired

        boolean hasExpired()
        Gets if the node has expired.

        This returns false if the node is not temporary.

        Returns:
        true if this node has expired
      • getExpiryDuration

        @Nullable Duration getExpiryDuration()
        Gets the time until this node will expire.

        Returns null if the node doesn't have an expiry time, and a negative duration if it has already expired.

        Returns:
        the duration until the nodes expiry
        Since:
        5.1
      • getContexts

        @NonNull ImmutableContextSet getContexts()
        Gets the contexts required for this node to apply.
        Returns:
        the contexts required for this node to apply
      • getMetadata

        <T> Optional<T> getMetadata​(NodeMetadataKey<T> key)
        Gets the metadata corresponding to the given key, if present.
        Type Parameters:
        T - the metadata type
        Parameters:
        key - the key
        Returns:
        the data, if present
      • metadata

        default <T> T metadata​(NodeMetadataKey<T> key)
                        throws IllegalStateException
        Gets the metadata corresponding to the given key, throwing an exception if no data is present.
        Type Parameters:
        T - the metadata type
        Parameters:
        key - the key
        Returns:
        the data
        Throws:
        IllegalStateException - if data isn't present
      • equals

        boolean equals​(Object obj)
        Gets if this Node is equal to another node.
        Overrides:
        equals in class Object
        Parameters:
        obj - the other node
        Returns:
        true if this node is equal to the other provided
        See Also:
        NodeEqualityPredicate.EXACT
      • toBuilder

        @NonNull NodeBuilder<?,​?> toBuilder()
        Gets a NodeBuilder, with the attributes of this node already applied.
        Returns:
        an editable, builder form of this node