Package org.kiwiproject.consul.model.kv
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().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableOperation.Builderbuilder()Creates a builder forImmutableOperation.static ImmutableOperationCreates an immutable copy of aOperationvalue.booleanThis instance is equal to all instances ofImmutableOperationthat have equal attribute values.flags()inthashCode()Computes a hash code from attributes:verb,key,value,flags,index,session.index()key()session()toString()Prints the immutable valueOperationwith attribute values.value()verb()final ImmutableOperationwithFlags(long value) Copy the current immutable object by setting a present value for the optionalflagsattribute.final ImmutableOperationCopy the current immutable object by setting an optional value for theflagsattribute.final ImmutableOperationwithIndex(BigInteger value) Copy the current immutable object by setting a present value for the optionalindexattribute.final ImmutableOperationwithIndex(Optional<? extends BigInteger> optional) Copy the current immutable object by setting an optional value for theindexattribute.final ImmutableOperationCopy the current immutable object by setting a present value for the optionalkeyattribute.final ImmutableOperationCopy the current immutable object by setting an optional value for thekeyattribute.final ImmutableOperationwithSession(String value) Copy the current immutable object by setting a present value for the optionalsessionattribute.final ImmutableOperationwithSession(Optional<String> optional) Copy the current immutable object by setting an optional value for thesessionattribute.final ImmutableOperationCopy the current immutable object by setting a present value for the optionalvalueattribute.final ImmutableOperationCopy the current immutable object by setting an optional value for thevalueattribute.final ImmutableOperationCopy the current immutable object by setting a value for theverbattribute.
-
Method Details
-
verb
-
key
-
value
-
flags
-
index
-
session
-
withVerb
Copy the current immutable object by setting a value for theverbattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for verb- Returns:
- A modified copy of the
thisobject
-
withKey
Copy the current immutable object by setting a present value for the optionalkeyattribute.- Parameters:
value- The value for key- Returns:
- A modified copy of
thisobject
-
withKey
Copy the current immutable object by setting an optional value for thekeyattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for key- Returns:
- A modified copy of
thisobject
-
withValue
Copy the current immutable object by setting a present value for the optionalvalueattribute.- Parameters:
value- The value for value- Returns:
- A modified copy of
thisobject
-
withValue
Copy the current immutable object by setting an optional value for thevalueattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for value- Returns:
- A modified copy of
thisobject
-
withFlags
Copy the current immutable object by setting a present value for the optionalflagsattribute.- Parameters:
value- The value for flags- Returns:
- A modified copy of
thisobject
-
withFlags
Copy the current immutable object by setting an optional value for theflagsattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for flags- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting a present value for the optionalindexattribute.- Parameters:
value- The value for index- Returns:
- A modified copy of
thisobject
-
withIndex
Copy the current immutable object by setting an optional value for theindexattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for index- Returns:
- A modified copy of
thisobject
-
withSession
Copy the current immutable object by setting a present value for the optionalsessionattribute.- Parameters:
value- The value for session- Returns:
- A modified copy of
thisobject
-
withSession
Copy the current immutable object by setting an optional value for thesessionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for session- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableOperationthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:verb,key,value,flags,index,session. -
toString
Prints the immutable valueOperationwith attribute values. -
copyOf
Creates an immutable copy of aOperationvalue. 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
Creates a builder forImmutableOperation.ImmutableOperation.builder() .verb(String) // requiredverb.key(String) // optionalkey.value(String) // optionalvalue.flags(Long) // optionalflags.index(java.math.BigInteger) // optionalindex.session(String) // optionalsession.build();- Returns:
- A new ImmutableOperation builder
-