Class ImmutableTxResponse

java.lang.Object
org.kiwiproject.consul.model.kv.TxResponse
org.kiwiproject.consul.model.kv.ImmutableTxResponse

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

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

  • Method Details

    • results

      public com.google.common.collect.ImmutableList<Map<String,Value>> results()
      Specified by:
      results in class TxResponse
      Returns:
      The value of the results attribute
    • errors

      public com.google.common.collect.ImmutableList<TxError> errors()
      Specified by:
      errors in class TxResponse
      Returns:
      The value of the errors attribute
    • withResults

      @SafeVarargs public final ImmutableTxResponse withResults(Map<String,Value>... elements)
      Copy the current immutable object with elements that replace the content of results.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withResults

      public final ImmutableTxResponse withResults(Iterable<? extends Map<String,Value>> elements)
      Copy the current immutable object with elements that replace the content of results. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of results elements to set
      Returns:
      A modified copy of this object
    • withErrors

      public final ImmutableTxResponse withErrors(TxError... elements)
      Copy the current immutable object with elements that replace the content of errors.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withErrors

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

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

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

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

      public static ImmutableTxResponse.Builder builder()
      Creates a builder for ImmutableTxResponse.
       ImmutableTxResponse.builder()
          .addResults|addAllResults(Map&lt;String, org.kiwiproject.consul.model.kv.Value&gt;) // results elements
          .addErrors|addAllErrors(org.kiwiproject.consul.model.kv.TxError) // errors elements
          .build();
       
      Returns:
      A new ImmutableTxResponse builder