Package com.orbitz.consul.model.kv
Class ImmutableTxError
- java.lang.Object
-
- com.orbitz.consul.model.kv.TxError
-
- com.orbitz.consul.model.kv.ImmutableTxError
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTxError.BuilderBuilds instances of typeImmutableTxError.
-
Method Summary
Modifier and Type Method Description static ImmutableTxError.Builderbuilder()Creates a builder forImmutableTxError.static ImmutableTxErrorcopyOf(TxError instance)Creates an immutable copy of aTxErrorvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableTxErrorthat have equal attribute values.inthashCode()Computes a hash code from attributes:opIndex,what.java.util.Optional<java.math.BigInteger>opIndex()java.lang.StringtoString()Prints the immutable valueTxErrorwith attribute values.java.util.Optional<java.lang.String>what()ImmutableTxErrorwithOpIndex(java.math.BigInteger value)Copy the current immutable object by setting a present value for the optionalopIndexattribute.ImmutableTxErrorwithOpIndex(java.util.Optional<? extends java.math.BigInteger> optional)Copy the current immutable object by setting an optional value for theopIndexattribute.ImmutableTxErrorwithWhat(java.lang.String value)Copy the current immutable object by setting a present value for the optionalwhatattribute.ImmutableTxErrorwithWhat(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thewhatattribute.
-
-
-
Method Detail
-
opIndex
public java.util.Optional<java.math.BigInteger> opIndex()
-
what
public java.util.Optional<java.lang.String> what()
-
withOpIndex
public final ImmutableTxError withOpIndex(java.math.BigInteger value)
Copy the current immutable object by setting a present value for the optionalopIndexattribute.- Parameters:
value- The value for opIndex- Returns:
- A modified copy of
thisobject
-
withOpIndex
public final ImmutableTxError withOpIndex(java.util.Optional<? extends java.math.BigInteger> optional)
Copy the current immutable object by setting an optional value for theopIndexattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for opIndex- Returns:
- A modified copy of
thisobject
-
withWhat
public final ImmutableTxError withWhat(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalwhatattribute.- Parameters:
value- The value for what- Returns:
- A modified copy of
thisobject
-
withWhat
public final ImmutableTxError withWhat(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thewhatattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for what- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableTxErrorthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:opIndex,what.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueTxErrorwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTxError copyOf(TxError instance)
Creates an immutable copy of aTxErrorvalue. 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 TxError instance
-
builder
public static ImmutableTxError.Builder builder()
Creates a builder forImmutableTxError.ImmutableTxError.builder() .opIndex(java.math.BigInteger) // optionalopIndex.what(String) // optionalwhat.build();- Returns:
- A new ImmutableTxError builder
-
-