Interface NodeBuilder<N extends ScopedNode<N,B>,B extends NodeBuilder<N,B>>

Type Parameters:
N - the node type
B - 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 for Nodes.
  • Method Details

    • value

      @NonNull B value(boolean value)
      Sets the value of the node.
      Parameters:
      value - the value
      Returns:
      the builder
      See Also:
    • negated

      @NonNull B negated(boolean negated)
      Sets the value of negated for the node.
      Parameters:
      negated - the value
      Returns:
      the builder
      See Also:
    • 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:
    • expiry

      Sets the time when the node should expire.
      Parameters:
      expiry - the expiry time
      Returns:
      the builder
      See Also:
    • 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:
    • expiry

      default @NonNull B expiry(long duration, @NonNull 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 for
      unit - the unit duration is 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:
    • withContext

      @NonNull B withContext(@NonNull String key, @NonNull String value)
      Appends an extra context onto the node.
      Parameters:
      key - the context key
      value - the context value
      Returns:
      the builder
      See Also:
    • withContext

      @NonNull B withContext(@NonNull ContextSet contextSet)
      Appends extra contexts onto the node.
      Parameters:
      contextSet - a context set
      Returns:
      the builder
      See Also:
    • 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 key
      metadata - the metadata
      Returns:
      the builder
    • build

      @NonNull N build()
      Creates a Node instance from the builder.
      Returns:
      a new node instance