Class ImmutableTokenResponse.Builder

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

public static final class ImmutableTokenResponse.Builder extends Object
Builds instances of type ImmutableTokenResponse. 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 ImmutableTokenResponse.Builder from(TokenResponse instance)
      Fill a builder with attribute values from the provided org.kiwiproject.consul.model.acl.TokenResponse instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder from(BaseTokenResponse instance)
      Fill a builder with attribute values from the provided org.kiwiproject.consul.model.acl.BaseTokenResponse instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • accessorId

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder accessorId(String accessorId)
      Initializes the value for the accessorId attribute.
      Parameters:
      accessorId - The value for accessorId
      Returns:
      this builder for use in a chained invocation
    • description

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder description(String description)
      Initializes the value for the description attribute.
      Parameters:
      description - The value for description
      Returns:
      this builder for use in a chained invocation
    • addPolicies

      @CanIgnoreReturnValue public final ImmutableTokenResponse.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 ImmutableTokenResponse.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 ImmutableTokenResponse.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 ImmutableTokenResponse.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
    • createIndex

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder createIndex(BigInteger createIndex)
      Initializes the value for the createIndex attribute.
      Parameters:
      createIndex - The value for createIndex
      Returns:
      this builder for use in a chained invocation
    • modifyIndex

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder modifyIndex(BigInteger modifyIndex)
      Initializes the value for the modifyIndex attribute.
      Parameters:
      modifyIndex - The value for modifyIndex
      Returns:
      this builder for use in a chained invocation
    • local

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder local(boolean local)
      Initializes the value for the local attribute.
      Parameters:
      local - The value for local
      Returns:
      this builder for use in a chained invocation
    • createTime

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder createTime(Date createTime)
      Initializes the value for the createTime attribute.
      Parameters:
      createTime - The value for createTime
      Returns:
      this builder for use in a chained invocation
    • hash

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder hash(String hash)
      Initializes the value for the hash attribute.
      Parameters:
      hash - The value for hash
      Returns:
      this builder for use in a chained invocation
    • secretId

      @CanIgnoreReturnValue public final ImmutableTokenResponse.Builder secretId(String secretId)
      Initializes the value for the secretId attribute.
      Parameters:
      secretId - The value for secretId
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableTokenResponse build()
      Returns:
      An immutable instance of TokenResponse
      Throws:
      IllegalStateException - if any required attributes are missing