Class ImmutableToken.Builder

java.lang.Object
org.kiwiproject.consul.model.acl.ImmutableToken.Builder
Enclosing class:
ImmutableToken

public static final class ImmutableToken.Builder extends Object
Builds instances of type ImmutableToken. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableToken.Builder from(Token instance)
      Fill a builder with attribute values from the provided Token instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • id

      @CanIgnoreReturnValue public final ImmutableToken.Builder id(String id)
      Initializes the optional value id to id.
      Parameters:
      id - The value for id
      Returns:
      this builder for chained invocation
    • id

      @CanIgnoreReturnValue public final ImmutableToken.Builder id(Optional<String> id)
      Initializes the optional value id to id.
      Parameters:
      id - The value for id
      Returns:
      this builder for use in a chained invocation
    • secretId

      @CanIgnoreReturnValue public final ImmutableToken.Builder secretId(String secretId)
      Initializes the optional value secretId to secretId.
      Parameters:
      secretId - The value for secretId
      Returns:
      this builder for chained invocation
    • secretId

      @CanIgnoreReturnValue public final ImmutableToken.Builder secretId(Optional<String> secretId)
      Initializes the optional value secretId to secretId.
      Parameters:
      secretId - The value for secretId
      Returns:
      this builder for use in a chained invocation
    • description

      @CanIgnoreReturnValue public final ImmutableToken.Builder description(String description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for chained invocation
    • description

      @CanIgnoreReturnValue public final ImmutableToken.Builder description(Optional<String> description)
      Initializes the optional value description to description.
      Parameters:
      description - The value for description
      Returns:
      this builder for use in a chained invocation
    • addPolicies

      @CanIgnoreReturnValue public final ImmutableToken.Builder addPolicies(Token.PolicyLink element)
      Adds one element to policies list.
      Parameters:
      element - A policies element
      Returns:
      this builder for use in a chained invocation
    • addPolicies

      @CanIgnoreReturnValue public final ImmutableToken.Builder addPolicies(Token.PolicyLink... elements)
      Adds elements to policies list.
      Parameters:
      elements - An array of policies elements
      Returns:
      this builder for use in a chained invocation
    • policies

      @CanIgnoreReturnValue public final ImmutableToken.Builder policies(Iterable<? extends Token.PolicyLink> elements)
      Sets or replaces all elements for policies list.
      Parameters:
      elements - An iterable of policies elements
      Returns:
      this builder for use in a chained invocation
    • addAllPolicies

      @CanIgnoreReturnValue public final ImmutableToken.Builder addAllPolicies(Iterable<? extends Token.PolicyLink> elements)
      Adds elements to policies list.
      Parameters:
      elements - An iterable of policies elements
      Returns:
      this builder for use in a chained invocation
    • addRoles

      @CanIgnoreReturnValue public final ImmutableToken.Builder addRoles(Token.RoleLink element)
      Adds one element to roles list.
      Parameters:
      element - A roles element
      Returns:
      this builder for use in a chained invocation
    • addRoles

      @CanIgnoreReturnValue public final ImmutableToken.Builder addRoles(Token.RoleLink... elements)
      Adds elements to roles list.
      Parameters:
      elements - An array of roles elements
      Returns:
      this builder for use in a chained invocation
    • roles

      @CanIgnoreReturnValue public final ImmutableToken.Builder roles(Iterable<? extends Token.RoleLink> elements)
      Sets or replaces all elements for roles list.
      Parameters:
      elements - An iterable of roles elements
      Returns:
      this builder for use in a chained invocation
    • addAllRoles

      @CanIgnoreReturnValue public final ImmutableToken.Builder addAllRoles(Iterable<? extends Token.RoleLink> elements)
      Adds elements to roles list.
      Parameters:
      elements - An iterable of roles elements
      Returns:
      this builder for use in a chained invocation
    • addServiceIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder addServiceIdentities(Token.ServiceIdentity element)
      Adds one element to serviceIdentities list.
      Parameters:
      element - A serviceIdentities element
      Returns:
      this builder for use in a chained invocation
    • addServiceIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder addServiceIdentities(Token.ServiceIdentity... elements)
      Adds elements to serviceIdentities list.
      Parameters:
      elements - An array of serviceIdentities elements
      Returns:
      this builder for use in a chained invocation
    • serviceIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder serviceIdentities(Iterable<? extends Token.ServiceIdentity> elements)
      Sets or replaces all elements for serviceIdentities list.
      Parameters:
      elements - An iterable of serviceIdentities elements
      Returns:
      this builder for use in a chained invocation
    • addAllServiceIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder addAllServiceIdentities(Iterable<? extends Token.ServiceIdentity> elements)
      Adds elements to serviceIdentities list.
      Parameters:
      elements - An iterable of serviceIdentities elements
      Returns:
      this builder for use in a chained invocation
    • addNodeIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder addNodeIdentities(Token.NodeIdentity element)
      Adds one element to nodeIdentities list.
      Parameters:
      element - A nodeIdentities element
      Returns:
      this builder for use in a chained invocation
    • addNodeIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder addNodeIdentities(Token.NodeIdentity... elements)
      Adds elements to nodeIdentities list.
      Parameters:
      elements - An array of nodeIdentities elements
      Returns:
      this builder for use in a chained invocation
    • nodeIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder nodeIdentities(Iterable<? extends Token.NodeIdentity> elements)
      Sets or replaces all elements for nodeIdentities list.
      Parameters:
      elements - An iterable of nodeIdentities elements
      Returns:
      this builder for use in a chained invocation
    • addAllNodeIdentities

      @CanIgnoreReturnValue public final ImmutableToken.Builder addAllNodeIdentities(Iterable<? extends Token.NodeIdentity> elements)
      Adds elements to nodeIdentities list.
      Parameters:
      elements - An iterable of nodeIdentities elements
      Returns:
      this builder for use in a chained invocation
    • local

      @CanIgnoreReturnValue public final ImmutableToken.Builder local(boolean local)
      Initializes the optional value local to local.
      Parameters:
      local - The value for local
      Returns:
      this builder for chained invocation
    • local

      @CanIgnoreReturnValue public final ImmutableToken.Builder local(Optional<Boolean> local)
      Initializes the optional value local to local.
      Parameters:
      local - The value for local
      Returns:
      this builder for use in a chained invocation
    • expirationTime

      @CanIgnoreReturnValue public final ImmutableToken.Builder expirationTime(String expirationTime)
      Initializes the optional value expirationTime to expirationTime.
      Parameters:
      expirationTime - The value for expirationTime
      Returns:
      this builder for chained invocation
    • expirationTime

      @CanIgnoreReturnValue public final ImmutableToken.Builder expirationTime(Optional<String> expirationTime)
      Initializes the optional value expirationTime to expirationTime.
      Parameters:
      expirationTime - The value for expirationTime
      Returns:
      this builder for use in a chained invocation
    • expirationTTL

      @CanIgnoreReturnValue public final ImmutableToken.Builder expirationTTL(String expirationTTL)
      Initializes the optional value expirationTTL to expirationTTL.
      Parameters:
      expirationTTL - The value for expirationTTL
      Returns:
      this builder for chained invocation
    • expirationTTL

      @CanIgnoreReturnValue public final ImmutableToken.Builder expirationTTL(Optional<String> expirationTTL)
      Initializes the optional value expirationTTL to expirationTTL.
      Parameters:
      expirationTTL - The value for expirationTTL
      Returns:
      this builder for use in a chained invocation
    • namespace

      @CanIgnoreReturnValue public final ImmutableToken.Builder namespace(String namespace)
      Initializes the optional value namespace to namespace.
      Parameters:
      namespace - The value for namespace
      Returns:
      this builder for chained invocation
    • namespace

      @CanIgnoreReturnValue public final ImmutableToken.Builder namespace(Optional<String> namespace)
      Initializes the optional value namespace to namespace.
      Parameters:
      namespace - The value for namespace
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableToken build()
      Builds a new ImmutableToken.
      Returns:
      An immutable instance of Token
      Throws:
      IllegalStateException - if any required attributes are missing