Package org.kiwiproject.consul.model.kv
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().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableTxResponse. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTxResponse.Builderbuilder()Creates a builder forImmutableTxResponse.static ImmutableTxResponsecopyOf(TxResponse instance) Creates an immutable copy of aTxResponsevalue.booleanThis 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.results()toString()Prints the immutable valueTxResponsewith attribute values.final ImmutableTxResponsewithErrors(Iterable<? extends TxError> elements) Copy the current immutable object with elements that replace the content oferrors.final ImmutableTxResponsewithErrors(TxError... elements) Copy the current immutable object with elements that replace the content oferrors.final ImmutableTxResponsewithResults(Iterable<? extends Map<String, Value>> elements) Copy the current immutable object with elements that replace the content ofresults.final ImmutableTxResponsewithResults(Map<String, Value>... elements) Copy the current immutable object with elements that replace the content ofresults.
-
Method Details
-
results
- Specified by:
resultsin classTxResponse- Returns:
- The value of the
resultsattribute
-
errors
- Specified by:
errorsin classTxResponse- Returns:
- The value of the
errorsattribute
-
withResults
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
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
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
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
This instance is equal to all instances ofImmutableTxResponsethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:results,errors. -
toString
Prints the immutable valueTxResponsewith attribute values. -
copyOf
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
Creates a builder forImmutableTxResponse.ImmutableTxResponse.builder() .addResults|addAllResults(Map<String, org.kiwiproject.consul.model.kv.Value>) //resultselements .addErrors|addAllErrors(org.kiwiproject.consul.model.kv.TxError) //errorselements .build();- Returns:
- A new ImmutableTxResponse builder
-