Class ImmutableOperation

java.lang.Object
org.kiwiproject.consul.model.kv.Operation
org.kiwiproject.consul.model.kv.ImmutableOperation

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

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

  • Method Details

    • verb

      public String verb()
      Specified by:
      verb in class Operation
      Returns:
      The value of the verb attribute
    • key

      public Optional<String> key()
      Specified by:
      key in class Operation
      Returns:
      The value of the key attribute
    • value

      public Optional<String> value()
      Specified by:
      value in class Operation
      Returns:
      The value of the value attribute
    • flags

      public Optional<Long> flags()
      Specified by:
      flags in class Operation
      Returns:
      The value of the flags attribute
    • index

      public Optional<BigInteger> index()
      Specified by:
      index in class Operation
      Returns:
      The value of the index attribute
    • session

      public Optional<String> session()
      Specified by:
      session in class Operation
      Returns:
      The value of the session attribute
    • withVerb

      public final ImmutableOperation withVerb(String value)
      Copy the current immutable object by setting a value for the verb attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for verb
      Returns:
      A modified copy of the this object
    • withKey

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

      public final ImmutableOperation withKey(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the key 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 key
      Returns:
      A modified copy of this object
    • withValue

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

      public final ImmutableOperation withValue(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the value 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 value
      Returns:
      A modified copy of this object
    • withFlags

      public final ImmutableOperation withFlags(long value)
      Copy the current immutable object by setting a present value for the optional flags attribute.
      Parameters:
      value - The value for flags
      Returns:
      A modified copy of this object
    • withFlags

      public final ImmutableOperation withFlags(Optional<Long> optional)
      Copy the current immutable object by setting an optional value for the flags 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 flags
      Returns:
      A modified copy of this object
    • withIndex

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

      public final ImmutableOperation withIndex(Optional<? extends BigInteger> optional)
      Copy the current immutable object by setting an optional value for the index 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 index
      Returns:
      A modified copy of this object
    • withSession

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

      public final ImmutableOperation withSession(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the session 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 session
      Returns:
      A modified copy of this object
    • equals

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

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

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

      public static ImmutableOperation.Builder builder()
      Creates a builder for ImmutableOperation.
       ImmutableOperation.builder()
          .verb(String) // required verb
          .key(String) // optional key
          .value(String) // optional value
          .flags(Long) // optional flags
          .index(java.math.BigInteger) // optional index
          .session(String) // optional session
          .build();
       
      Returns:
      A new ImmutableOperation builder