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

    • 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 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 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
      • 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