Package com.orbitz.consul.model.kv
Class ImmutableTxResponse
- java.lang.Object
-
- com.orbitz.consul.model.kv.TxResponse
-
- com.orbitz.consul.model.kv.ImmutableTxResponse
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTxResponse extends TxResponseImmutable implementation ofTxResponse.Use the builder to create immutable instances:
ImmutableTxResponse.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTxResponse.BuilderBuilds instances of typeImmutableTxResponse.
-
Method Summary
Modifier and Type Method Description static ImmutableTxResponse.Builderbuilder()Creates a builder forImmutableTxResponse.static ImmutableTxResponsecopyOf(TxResponse instance)Creates an immutable copy of aTxResponsevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableTxResponsethat have equal attribute values.com.google.common.collect.ImmutableList<TxError>errors()inthashCode()Computes a hash code from attributes:results,errors.com.google.common.collect.ImmutableList<java.util.Map<java.lang.String,Value>>results()java.lang.StringtoString()Prints the immutable valueTxResponsewith attribute values.ImmutableTxResponsewithErrors(TxError... elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableTxResponsewithErrors(java.lang.Iterable<? extends TxError> elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableTxResponsewithResults(java.lang.Iterable<? extends java.util.Map<java.lang.String,Value>> elements)Copy the current immutable object with elements that replace the content ofresults.ImmutableTxResponsewithResults(java.util.Map<java.lang.String,Value>... elements)Copy the current immutable object with elements that replace the content ofresults.
-
-
-
Method Detail
-
results
public com.google.common.collect.ImmutableList<java.util.Map<java.lang.String,Value>> results()
- Specified by:
resultsin classTxResponse- Returns:
- The value of the
resultsattribute
-
errors
public com.google.common.collect.ImmutableList<TxError> errors()
- Specified by:
errorsin classTxResponse- Returns:
- The value of the
errorsattribute
-
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 ofresults.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
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 ofresults. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of results elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
public final ImmutableTxResponse withErrors(TxError... elements)
Copy the current immutable object with elements that replace the content oferrors.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
public final ImmutableTxResponse withErrors(java.lang.Iterable<? extends TxError> elements)
Copy the current immutable object with elements that replace the content oferrors. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of errors elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableTxResponsethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:results,errors.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueTxResponsewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTxResponse copyOf(TxResponse instance)
Creates an immutable copy of aTxResponsevalue. 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 forImmutableTxResponse.ImmutableTxResponse.builder() .addResults|addAllResults(Map<String, com.orbitz.consul.model.kv.Value>) //resultselements .addErrors|addAllErrors(com.orbitz.consul.model.kv.TxError) //errorselements .build();- Returns:
- A new ImmutableTxResponse builder
-
-