Class ImmutableQueryParameterOptions

java.lang.Object
org.kiwiproject.consul.option.QueryParameterOptions
org.kiwiproject.consul.option.ImmutableQueryParameterOptions
All Implemented Interfaces:
ParamAdder

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

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

  • Method Details

    • toQuery

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

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

      public Optional<Boolean> getReplaceExistingChecks()
      Specified by:
      getReplaceExistingChecks in class QueryParameterOptions
      Returns:
      The value of the replaceExistingChecks attribute
    • getPrune

      public Optional<Boolean> getPrune()
      Specified by:
      getPrune in class QueryParameterOptions
      Returns:
      The value of the prune attribute
    • withToQuery

      public final ImmutableQueryParameterOptions withToQuery(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the toQuery 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 toQuery map
      Returns:
      A modified copy of this object
    • withToHeaders

      public final ImmutableQueryParameterOptions 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
    • withReplaceExistingChecks

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

      public final ImmutableQueryParameterOptions withReplaceExistingChecks(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the replaceExistingChecks 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 replaceExistingChecks
      Returns:
      A modified copy of this object
    • withPrune

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

      public final ImmutableQueryParameterOptions withPrune(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the prune 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 prune
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableQueryParameterOptions 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: toQuery, toHeaders, replaceExistingChecks, prune.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableQueryParameterOptions.Builder builder()
      Creates a builder for ImmutableQueryParameterOptions.
       ImmutableQueryParameterOptions.builder()
          .putToQuery|putAllToQuery(String => Object) // toQuery mappings
          .putToHeaders|putAllToHeaders(String => String) // toHeaders mappings
          .replaceExistingChecks(Boolean) // optional replaceExistingChecks
          .prune(Boolean) // optional prune
          .build();
       
      Returns:
      A new ImmutableQueryParameterOptions builder