Class ImmutableTokenQueryOptions

java.lang.Object
org.kiwiproject.consul.option.TokenQueryOptions
org.kiwiproject.consul.option.ImmutableTokenQueryOptions
All Implemented Interfaces:
ParamAdder

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTokenQueryOptions extends TokenQueryOptions
Immutable implementation of TokenQueryOptions.

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

  • Method Details

    • toQueryParameters

      public com.google.common.collect.ImmutableList<String> toQueryParameters()
      Returns:
      The value of the toQueryParameters attribute
    • toHeaders

      public com.google.common.collect.ImmutableMap<String,String> toHeaders()
      Returns:
      The value of the toHeaders attribute
    • getPolicy

      public Optional<String> getPolicy()
      Specified by:
      getPolicy in class TokenQueryOptions
      Returns:
      The value of the policy attribute
    • getRole

      public Optional<String> getRole()
      Specified by:
      getRole in class TokenQueryOptions
      Returns:
      The value of the role attribute
    • getAuthMethod

      public Optional<String> getAuthMethod()
      Specified by:
      getAuthMethod in class TokenQueryOptions
      Returns:
      The value of the authMethod attribute
    • getAuthMethodNamespace

      public Optional<String> getAuthMethodNamespace()
      Specified by:
      getAuthMethodNamespace in class TokenQueryOptions
      Returns:
      The value of the authMethodNamespace attribute
    • getNamespace

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

      public final ImmutableTokenQueryOptions withToQueryParameters(String... elements)
      Copy the current immutable object with elements that replace the content of toQueryParameters.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withToQueryParameters

      public final ImmutableTokenQueryOptions withToQueryParameters(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of toQueryParameters. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of toQueryParameters elements to set
      Returns:
      A modified copy of this object
    • withToHeaders

      public final ImmutableTokenQueryOptions withToHeaders(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the toHeaders map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the toHeaders map
      Returns:
      A modified copy of this object
    • withPolicy

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

      public final ImmutableTokenQueryOptions withPolicy(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the policy 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 policy
      Returns:
      A modified copy of this object
    • withRole

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

      public final ImmutableTokenQueryOptions withRole(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the role 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 role
      Returns:
      A modified copy of this object
    • withAuthMethod

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

      public final ImmutableTokenQueryOptions withAuthMethod(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the authMethod 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 authMethod
      Returns:
      A modified copy of this object
    • withAuthMethodNamespace

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

      public final ImmutableTokenQueryOptions withAuthMethodNamespace(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the authMethodNamespace 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 authMethodNamespace
      Returns:
      A modified copy of this object
    • withNamespace

      public final ImmutableTokenQueryOptions 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 ImmutableTokenQueryOptions 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 ImmutableTokenQueryOptions 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: toQueryParameters, toHeaders, policy, role, authMethod, authMethodNamespace, namespace.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTokenQueryOptions.Builder builder()
      Creates a builder for ImmutableTokenQueryOptions.
       ImmutableTokenQueryOptions.builder()
          .addToQueryParameters|addAllToQueryParameters(String) // toQueryParameters elements
          .putToHeaders|putAllToHeaders(String => String) // toHeaders mappings
          .policy(String) // optional policy
          .role(String) // optional role
          .authMethod(String) // optional authMethod
          .authMethodNamespace(String) // optional authMethodNamespace
          .namespace(String) // optional namespace
          .build();
       
      Returns:
      A new ImmutableTokenQueryOptions builder