Class ImmutableTxResponse


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

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

    • Method Detail

      • results

        public com.google.common.collect.ImmutableList<java.util.Map<java.lang.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​(java.util.Map<java.lang.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​(java.lang.Iterable<? extends java.util.Map<java.lang.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​(java.lang.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableTxResponse that have equal attribute values.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value TxResponse with attribute values.
        Overrides:
        toString in class java.lang.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, com.orbitz.consul.model.kv.Value&gt;) // results elements
            .addErrors|addAllErrors(com.orbitz.consul.model.kv.TxError) // errors elements
            .build();
         
        Returns:
        A new ImmutableTxResponse builder