Package net.luckperms.api.node
Interface NodeBuilder<N extends ScopedNode<N,B>,B extends NodeBuilder<N,B>>
- Type Parameters:
N- the node typeB- the node builder type
- All Known Subinterfaces:
ChatMetaNode.Builder<N,,B> DisplayNameNode.Builder,InheritanceNode.Builder,MetaNode.Builder,PermissionNode.Builder,PrefixNode.Builder,RegexPermissionNode.Builder,SuffixNode.Builder,WeightNode.Builder
Builder for
Nodes.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aNodeinstance from the builder.Marks that the node being built should never expire.context(@NonNull ContextSet contextSet) Sets the extra contexts for the node.expiry(long expiryEpochSeconds) Sets the time when the node should expire.Sets the time when the node should expire.expiry(@Nullable TemporalAccessor expiry) Sets the time when the node should expire.expiry(@Nullable TemporalAmount duration) Sets the time when the node should expire.negated(boolean negated) Sets the value of negated for the node.value(boolean value) Sets the value of the node.withContext(@NonNull String key, @NonNull String value) Appends an extra context onto the node.withContext(@NonNull ContextSet contextSet) Appends extra contexts onto the node.withMetadata(@NonNull NodeMetadataKey<T> key, @Nullable T metadata) Sets the given metadata for the node.
-
Method Details
-
value
Sets the value of the node.- Parameters:
value- the value- Returns:
- the builder
- See Also:
-
negated
Sets the value of negated for the node.- Parameters:
negated- the value- Returns:
- the builder
- See Also:
-
expiry
Sets the time when the node should expire.The parameter passed to this method must be the unix timestamp (in seconds) when the node should expire.
- Parameters:
expiryEpochSeconds- the expiry timestamp (unix seconds)- Returns:
- the builder
- See Also:
-
expiry
Sets the time when the node should expire.- Parameters:
expiry- the expiry time- Returns:
- the builder
- See Also:
-
expiry
Sets the time when the node should expire.The expiry time is calculated relative to the current system time.
- Parameters:
duration- how long the node should be added for- Returns:
- the builder
- Since:
- 5.1
- See Also:
-
expiry
Sets the time when the node should expire.The expiry time is calculated relative to the current system time.
- Parameters:
duration- how long the node should be added forunit- the unitdurationis measured in- Returns:
- the builder
-
clearExpiry
Marks that the node being built should never expire.- Returns:
- the builder
-
context
Sets the extra contexts for the node.- Parameters:
contextSet- a context set- Returns:
- the builder
- See Also:
-
withContext
Appends an extra context onto the node.- Parameters:
key- the context keyvalue- the context value- Returns:
- the builder
- See Also:
-
withContext
Appends extra contexts onto the node.- Parameters:
contextSet- a context set- Returns:
- the builder
- See Also:
-
withMetadata
Sets the given metadata for the node.- Type Parameters:
T- the metadata type- Parameters:
key- the metadata keymetadata- the metadata- Returns:
- the builder
-
build
Creates aNodeinstance from the builder.- Returns:
- a new node instance
-