Class ImmutableTokenResponse


@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableTokenResponse extends TokenResponse
Immutable implementation of TokenResponse.

Use the builder to create immutable instances: ImmutableTokenResponse.builder().

  • Method Details

    • accessorId

      public String accessorId()
      Specified by:
      accessorId in class BaseTokenResponse
      Returns:
      The value of the accessorId attribute
    • description

      public String description()
      Specified by:
      description in class BaseTokenResponse
      Returns:
      The value of the description attribute
    • policies

      public com.google.common.collect.ImmutableList<Token.PolicyLink> policies()
      Specified by:
      policies in class BaseTokenResponse
      Returns:
      The value of the policies attribute
    • createIndex

      public BigInteger createIndex()
      Specified by:
      createIndex in class BaseTokenResponse
      Returns:
      The value of the createIndex attribute
    • modifyIndex

      public BigInteger modifyIndex()
      Specified by:
      modifyIndex in class BaseTokenResponse
      Returns:
      The value of the modifyIndex attribute
    • local

      public boolean local()
      Specified by:
      local in class BaseTokenResponse
      Returns:
      The value of the local attribute
    • createTime

      public Date createTime()
      Specified by:
      createTime in class BaseTokenResponse
      Returns:
      The value of the createTime attribute
    • hash

      public String hash()
      Specified by:
      hash in class BaseTokenResponse
      Returns:
      The value of the hash attribute
    • secretId

      public String secretId()
      Specified by:
      secretId in class TokenResponse
      Returns:
      The value of the secretId attribute
    • withAccessorId

      public final ImmutableTokenResponse withAccessorId(String value)
      Copy the current immutable object by setting a value for the accessorId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for accessorId
      Returns:
      A modified copy of the this object
    • withDescription

      public final ImmutableTokenResponse withDescription(String value)
      Copy the current immutable object by setting a value for the description attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for description
      Returns:
      A modified copy of the this object
    • withPolicies

      public final ImmutableTokenResponse withPolicies(Token.PolicyLink... elements)
      Copy the current immutable object with elements that replace the content of policies.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPolicies

      public final ImmutableTokenResponse withPolicies(Iterable<? extends Token.PolicyLink> elements)
      Copy the current immutable object with elements that replace the content of policies. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of policies elements to set
      Returns:
      A modified copy of this object
    • withCreateIndex

      public final ImmutableTokenResponse withCreateIndex(BigInteger value)
      Copy the current immutable object by setting a value for the createIndex attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for createIndex
      Returns:
      A modified copy of the this object
    • withModifyIndex

      public final ImmutableTokenResponse withModifyIndex(BigInteger value)
      Copy the current immutable object by setting a value for the modifyIndex attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for modifyIndex
      Returns:
      A modified copy of the this object
    • withLocal

      public final ImmutableTokenResponse withLocal(boolean value)
      Copy the current immutable object by setting a value for the local attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for local
      Returns:
      A modified copy of the this object
    • withCreateTime

      public final ImmutableTokenResponse withCreateTime(Date value)
      Copy the current immutable object by setting a value for the createTime attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for createTime
      Returns:
      A modified copy of the this object
    • withHash

      public final ImmutableTokenResponse withHash(String value)
      Copy the current immutable object by setting a value for the hash attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hash
      Returns:
      A modified copy of the this object
    • withSecretId

      public final ImmutableTokenResponse withSecretId(String value)
      Copy the current immutable object by setting a value for the secretId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for secretId
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTokenResponse that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: accessorId, description, policies, createIndex, modifyIndex, local, createTime, hash, secretId.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TokenResponse with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableTokenResponse copyOf(TokenResponse instance)
      Creates an immutable copy of a TokenResponse value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable TokenResponse instance
    • builder

      public static ImmutableTokenResponse.Builder builder()
      Creates a builder for ImmutableTokenResponse.
       ImmutableTokenResponse.builder()
          .accessorId(String) // required accessorId
          .description(String) // required description
          .addPolicies|addAllPolicies(org.kiwiproject.consul.model.acl.Token.PolicyLink) // policies elements
          .createIndex(java.math.BigInteger) // required createIndex
          .modifyIndex(java.math.BigInteger) // required modifyIndex
          .local(boolean) // required local
          .createTime(Date) // required createTime
          .hash(String) // required hash
          .secretId(String) // required secretId
          .build();
       
      Returns:
      A new ImmutableTokenResponse builder