N - the node typeB - the node builder typepublic interface NodeBuilder<N extends ScopedNode<N,B>,B extends NodeBuilder<N,B>>
Nodes.| Modifier and Type | Method and Description |
|---|---|
N |
build()
Creates a
Node instance from the builder. |
B |
clearExpiry()
Marks that the node being built should never expire.
|
B |
context(@NonNull ContextSet contextSet)
Sets the extra contexts for the node.
|
B |
expiry(long expiryEpochSeconds)
Sets the time when the node should expire.
|
default B |
expiry(long duration,
TimeUnit unit)
Sets the time when the node should expire.
|
B |
expiry(@Nullable TemporalAccessor expiry)
Sets the time when the node should expire.
|
B |
expiry(@Nullable TemporalAmount duration)
Sets the time when the node should expire.
|
B |
negated(boolean negated)
Sets the value of negated for the node.
|
B |
value(boolean value)
Sets the value of the node.
|
B |
withContext(@NonNull ContextSet contextSet)
Appends extra contexts onto the node.
|
B |
withContext(@NonNull String key,
@NonNull String value)
Appends an extra context onto the node.
|
<T> B |
withMetadata(@NonNull NodeMetadataKey<T> key,
T metadata)
Sets the given metadata for the node.
|
B value(boolean value)
value - the valueNode.getValue()B negated(boolean negated)
negated - the valueNode.isNegated()B expiry(long expiryEpochSeconds)
The parameter passed to this method must be the unix timestamp (in seconds) when the node should expire.
expiryEpochSeconds - the expiry timestamp (unix seconds)Node.getExpiry()B expiry(@Nullable TemporalAccessor expiry)
expiry - the expiry timeNode.getExpiry()B expiry(@Nullable TemporalAmount duration)
The expiry time is calculated relative to the current system time.
duration - how long the node should be added forNode.getExpiry()default B expiry(long duration, TimeUnit unit)
The expiry time is calculated relative to the current system time.
duration - how long the node should be added forunit - the unit duration is measured inB clearExpiry()
B context(@NonNull ContextSet contextSet)
contextSet - a context setContextSet,
Node.getContexts()B withContext(@NonNull String key, @NonNull String value)
key - the context keyvalue - the context valueContextSet,
Node.getContexts()B withContext(@NonNull ContextSet contextSet)
contextSet - a context setContextSet,
Node.getContexts()<T> B withMetadata(@NonNull NodeMetadataKey<T> key, T metadata)
T - the metadata typekey - the metadata keymetadata - the metadata