Class ImmutableToken

java.lang.Object
org.kiwiproject.consul.model.acl.Token
org.kiwiproject.consul.model.acl.ImmutableToken

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

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

  • Method Details

    • id

      public Optional<String> id()
      Specified by:
      id in class Token
      Returns:
      The value of the id attribute
    • secretId

      public Optional<String> secretId()
      Specified by:
      secretId in class Token
      Returns:
      The value of the secretId attribute
    • description

      public Optional<String> description()
      Specified by:
      description in class Token
      Returns:
      The value of the description attribute
    • policies

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

      public com.google.common.collect.ImmutableList<Token.RoleLink> roles()
      Specified by:
      roles in class Token
      Returns:
      The value of the roles attribute
    • serviceIdentities

      public com.google.common.collect.ImmutableList<Token.ServiceIdentity> serviceIdentities()
      Specified by:
      serviceIdentities in class Token
      Returns:
      The value of the serviceIdentities attribute
    • nodeIdentities

      public com.google.common.collect.ImmutableList<Token.NodeIdentity> nodeIdentities()
      Specified by:
      nodeIdentities in class Token
      Returns:
      The value of the nodeIdentities attribute
    • local

      public Optional<Boolean> local()
      Specified by:
      local in class Token
      Returns:
      The value of the local attribute
    • expirationTime

      public Optional<String> expirationTime()
      Specified by:
      expirationTime in class Token
      Returns:
      The value of the expirationTime attribute
    • expirationTTL

      public Optional<String> expirationTTL()
      Specified by:
      expirationTTL in class Token
      Returns:
      The value of the expirationTTL attribute
    • namespace

      public Optional<String> namespace()
      Specified by:
      namespace in class Token
      Returns:
      The value of the namespace attribute
    • withId

      public final ImmutableToken withId(String value)
      Copy the current immutable object by setting a present value for the optional id attribute.
      Parameters:
      value - The value for id
      Returns:
      A modified copy of this object
    • withId

      public final ImmutableToken withId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the id attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for id
      Returns:
      A modified copy of this object
    • withSecretId

      public final ImmutableToken withSecretId(String value)
      Copy the current immutable object by setting a present value for the optional secretId attribute.
      Parameters:
      value - The value for secretId
      Returns:
      A modified copy of this object
    • withSecretId

      public final ImmutableToken withSecretId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the secretId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for secretId
      Returns:
      A modified copy of this object
    • withDescription

      public final ImmutableToken withDescription(String value)
      Copy the current immutable object by setting a present value for the optional description attribute.
      Parameters:
      value - The value for description
      Returns:
      A modified copy of this object
    • withDescription

      public final ImmutableToken withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for description
      Returns:
      A modified copy of this object
    • withPolicies

      public final ImmutableToken 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 ImmutableToken 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
    • withRoles

      public final ImmutableToken withRoles(Token.RoleLink... elements)
      Copy the current immutable object with elements that replace the content of roles.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withRoles

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

      public final ImmutableToken withServiceIdentities(Token.ServiceIdentity... elements)
      Copy the current immutable object with elements that replace the content of serviceIdentities.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withServiceIdentities

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

      public final ImmutableToken withNodeIdentities(Token.NodeIdentity... elements)
      Copy the current immutable object with elements that replace the content of nodeIdentities.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNodeIdentities

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

      public final ImmutableToken withLocal(boolean value)
      Copy the current immutable object by setting a present value for the optional local attribute.
      Parameters:
      value - The value for local
      Returns:
      A modified copy of this object
    • withLocal

      public final ImmutableToken withLocal(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the local attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for local
      Returns:
      A modified copy of this object
    • withExpirationTime

      public final ImmutableToken withExpirationTime(String value)
      Copy the current immutable object by setting a present value for the optional expirationTime attribute.
      Parameters:
      value - The value for expirationTime
      Returns:
      A modified copy of this object
    • withExpirationTime

      public final ImmutableToken withExpirationTime(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the expirationTime attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for expirationTime
      Returns:
      A modified copy of this object
    • withExpirationTTL

      public final ImmutableToken withExpirationTTL(String value)
      Copy the current immutable object by setting a present value for the optional expirationTTL attribute.
      Parameters:
      value - The value for expirationTTL
      Returns:
      A modified copy of this object
    • withExpirationTTL

      public final ImmutableToken withExpirationTTL(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the expirationTTL attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for expirationTTL
      Returns:
      A modified copy of this object
    • withNamespace

      public final ImmutableToken withNamespace(String value)
      Copy the current immutable object by setting a present value for the optional namespace attribute.
      Parameters:
      value - The value for namespace
      Returns:
      A modified copy of this object
    • withNamespace

      public final ImmutableToken withNamespace(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the namespace attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for namespace
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableToken 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: id, secretId, description, policies, roles, serviceIdentities, nodeIdentities, local, expirationTime, expirationTTL, namespace.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableToken copyOf(Token instance)
      Creates an immutable copy of a Token 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 Token instance
    • builder

      public static ImmutableToken.Builder builder()
      Creates a builder for ImmutableToken.
       ImmutableToken.builder()
          .id(String) // optional id
          .secretId(String) // optional secretId
          .description(String) // optional description
          .addPolicies|addAllPolicies(org.kiwiproject.consul.model.acl.Token.PolicyLink) // policies elements
          .addRoles|addAllRoles(org.kiwiproject.consul.model.acl.Token.RoleLink) // roles elements
          .addServiceIdentities|addAllServiceIdentities(org.kiwiproject.consul.model.acl.Token.ServiceIdentity) // serviceIdentities elements
          .addNodeIdentities|addAllNodeIdentities(org.kiwiproject.consul.model.acl.Token.NodeIdentity) // nodeIdentities elements
          .local(Boolean) // optional local
          .expirationTime(String) // optional expirationTime
          .expirationTTL(String) // optional expirationTTL
          .namespace(String) // optional namespace
          .build();
       
      Returns:
      A new ImmutableToken builder