public static interface Node.Builder
| Modifier and Type | Method and Description |
|---|---|
Node |
build()
Creates a
Node instance from the builder. |
Node.Builder |
clearExpiry()
Marks that the node being built should never expire.
|
Node.Builder |
copyFrom(Node node)
Copies the attributes from the given node and applies them to this
builder.
|
Node.Builder |
setExpiry(long expiryUnixTimestamp)
Sets the time when the node should expire.
|
default Node.Builder |
setExpiry(long duration,
TimeUnit unit)
Sets the time when the node should expire.
|
Node.Builder |
setExtraContext(ContextSet contextSet)
Sets the extra contexts for the node.
|
Node.Builder |
setNegated(boolean negated)
Sets the value of negated for the node.
|
Node.Builder |
setOverride(boolean override)
Sets the override property for the node.
|
Node.Builder |
setServer(String server)
Sets the server value for the node.
|
Node.Builder |
setValue(boolean value)
Sets the value of the node.
|
Node.Builder |
setWorld(String world)
Sets the world value for the node.
|
Node.Builder |
withExtraContext(ContextSet contextSet)
Appends extra contexts onto the node.
|
Node.Builder |
withExtraContext(Map.Entry<String,String> entry)
Appends an extra context onto the node.
|
Node.Builder |
withExtraContext(Map<String,String> map)
Appends extra contexts onto the node.
|
Node.Builder |
withExtraContext(Set<Map.Entry<String,String>> context)
Appends extra contexts onto the node.
|
Node.Builder |
withExtraContext(String key,
String value)
Appends an extra context onto the node.
|
Node.Builder copyFrom(@Nonnull Node node)
Note that this copies all attributes except the permission itself.
node - the node to copy from@Nonnull Node.Builder setNegated(boolean negated)
negated - the valueNode.isNegated()@Nonnull Node.Builder setValue(boolean value)
value - the valueNode.getValue()@Nonnull Node.Builder setOverride(boolean override)
Warning: this value does not persist, and disappears when the holder is re-loaded. It is therefore only useful for transient nodes.
override - the override stateNode.isOverride()@Nonnull Node.Builder setExpiry(long expiryUnixTimestamp)
The parameter passed to this method must be the unix timestamp (in seconds) when the node should expire.
expiryUnixTimestamp - the expiry timestamp (unix seconds)Node.getExpiryUnixTime()@Nonnull default Node.Builder setExpiry(long duration, TimeUnit unit)
The expiry timestamp is calculated relative to the current system time.
duration - how long the node should be added forunit - the unit duration is measured in@Nonnull Node.Builder clearExpiry()
@Nonnull Node.Builder setWorld(@Nullable String world)
world - the world valueNode.getWorld()@Nonnull Node.Builder setServer(@Nullable String server)
server - the world valueNode.getServer()@Nonnull Node.Builder withExtraContext(@Nonnull String key, @Nonnull String value)
key - the context keyvalue - the context valueContextSet,
Node.getContexts()@Nonnull Node.Builder withExtraContext(@Nonnull Map<String,String> map)
map - a map of contextsContextSet,
Node.getContexts()@Nonnull Node.Builder withExtraContext(@Nonnull Set<Map.Entry<String,String>> context)
context - a set of contextsContextSet,
Node.getContexts()@Nonnull Node.Builder withExtraContext(@Nonnull Map.Entry<String,String> entry)
entry - the contextContextSet,
Node.getContexts()@Nonnull Node.Builder withExtraContext(@Nonnull ContextSet contextSet)
contextSet - a context setContextSet,
Node.getContexts()@Nonnull Node.Builder setExtraContext(@Nonnull ContextSet contextSet)
contextSet - a context setContextSet,
Node.getContexts()Copyright © 2018. All rights reserved.