Class ImmutableTxError

java.lang.Object
org.kiwiproject.consul.model.kv.TxError
org.kiwiproject.consul.model.kv.ImmutableTxError

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

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

  • Method Details

    • opIndex

      public Optional<BigInteger> opIndex()
      Specified by:
      opIndex in class TxError
      Returns:
      The value of the opIndex attribute
    • what

      public Optional<String> what()
      Specified by:
      what in class TxError
      Returns:
      The value of the what attribute
    • withOpIndex

      public final ImmutableTxError withOpIndex(BigInteger value)
      Copy the current immutable object by setting a present value for the optional opIndex attribute.
      Parameters:
      value - The value for opIndex
      Returns:
      A modified copy of this object
    • withOpIndex

      public final ImmutableTxError withOpIndex(Optional<? extends BigInteger> optional)
      Copy the current immutable object by setting an optional value for the opIndex attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for opIndex
      Returns:
      A modified copy of this object
    • withWhat

      public final ImmutableTxError withWhat(String value)
      Copy the current immutable object by setting a present value for the optional what attribute.
      Parameters:
      value - The value for what
      Returns:
      A modified copy of this object
    • withWhat

      public final ImmutableTxError withWhat(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the what attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for what
      Returns:
      A modified copy of this object
    • equals

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

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

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

      public static ImmutableTxError.Builder builder()
      Creates a builder for ImmutableTxError.
       ImmutableTxError.builder()
          .opIndex(java.math.BigInteger) // optional opIndex
          .what(String) // optional what
          .build();
       
      Returns:
      A new ImmutableTxError builder