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
@NonExtendable public interface NodeBuilder<N extends ScopedNode<N,B>,B extends NodeBuilder<N,B>>
Builder forNodes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @NonNull Nbuild()Creates aNodeinstance from the builder.@NonNull BclearExpiry()Marks that the node being built should never expire.@NonNull Bcontext(@NonNull ContextSet contextSet)Sets the extra contexts for the node.@NonNull Bexpiry(long expiryEpochSeconds)Sets the time when the node should expire.default @NonNull Bexpiry(long duration, TimeUnit unit)Sets the time when the node should expire.@NonNull Bexpiry(@Nullable TemporalAccessor expiry)Sets the time when the node should expire.@NonNull Bexpiry(@Nullable TemporalAmount duration)Sets the time when the node should expire.@NonNull Bnegated(boolean negated)Sets the value of negated for the node.@NonNull Bvalue(boolean value)Sets the value of the node.@NonNull BwithContext(@NonNull String key, @NonNull String value)Appends an extra context onto the node.@NonNull BwithContext(@NonNull ContextSet contextSet)Appends extra contexts onto the node.<T> @NonNull BwithMetadata(@NonNull NodeMetadataKey<T> key, @Nullable T metadata)Sets the given metadata for the node.
-
-
-
Method Detail
-
value
@NonNull B value(boolean value)
Sets the value of the node.- Parameters:
value- the value- Returns:
- the builder
- See Also:
Node.getValue()
-
negated
@NonNull B negated(boolean negated)
Sets the value of negated for the node.- Parameters:
negated- the value- Returns:
- the builder
- See Also:
Node.isNegated()
-
expiry
@NonNull B expiry(long expiryEpochSeconds)
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:
Node.getExpiry()
-
expiry
@NonNull B expiry(@Nullable TemporalAccessor expiry)
Sets the time when the node should expire.- Parameters:
expiry- the expiry time- Returns:
- the builder
- See Also:
Node.getExpiry()
-
expiry
@NonNull B expiry(@Nullable TemporalAmount duration)
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:
Node.getExpiry()
-
expiry
default @NonNull B expiry(long duration, TimeUnit unit)
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
@NonNull B clearExpiry()
Marks that the node being built should never expire.- Returns:
- the builder
-
context
@NonNull B context(@NonNull ContextSet contextSet)
Sets the extra contexts for the node.- Parameters:
contextSet- a context set- Returns:
- the builder
- See Also:
ContextSet,Node.getContexts()
-
withContext
@NonNull B withContext(@NonNull String key, @NonNull String value)
Appends an extra context onto the node.- Parameters:
key- the context keyvalue- the context value- Returns:
- the builder
- See Also:
ContextSet,Node.getContexts()
-
withContext
@NonNull B withContext(@NonNull ContextSet contextSet)
Appends extra contexts onto the node.- Parameters:
contextSet- a context set- Returns:
- the builder
- See Also:
ContextSet,Node.getContexts()
-
withMetadata
<T> @NonNull B withMetadata(@NonNull NodeMetadataKey<T> key, @Nullable T metadata)
Sets the given metadata for the node.- Type Parameters:
T- the metadata type- Parameters:
key- the metadata keymetadata- the metadata- Returns:
- the builder
-
-