Package com.orbitz.consul.model.kv
Class ImmutableOperation
- java.lang.Object
-
- com.orbitz.consul.model.kv.Operation
-
- com.orbitz.consul.model.kv.ImmutableOperation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableOperation.BuilderBuilds instances of typeImmutableOperation.
-
Method Summary
Modifier and Type Method Description static ImmutableOperation.Builderbuilder()Creates a builder forImmutableOperation.static ImmutableOperationcopyOf(Operation instance)Creates an immutable copy of aOperationvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableOperationthat have equal attribute values.java.util.Optional<java.lang.Long>flags()inthashCode()Computes a hash code from attributes:verb,key,value,flags,index,session.java.util.Optional<java.math.BigInteger>index()java.util.Optional<java.lang.String>key()java.util.Optional<java.lang.String>session()java.lang.StringtoString()Prints the immutable valueOperationwith attribute values.java.util.Optional<java.lang.String>value()java.lang.Stringverb()ImmutableOperationwithFlags(long value)Copy the current immutable object by setting a present value for the optionalflagsattribute.ImmutableOperationwithFlags(java.util.Optional<java.lang.Long> optional)Copy the current immutable object by setting an optional value for theflagsattribute.ImmutableOperationwithIndex(java.math.BigInteger value)Copy the current immutable object by setting a present value for the optionalindexattribute.ImmutableOperationwithIndex(java.util.Optional<? extends java.math.BigInteger> optional)Copy the current immutable object by setting an optional value for theindexattribute.ImmutableOperationwithKey(java.lang.String value)Copy the current immutable object by setting a present value for the optionalkeyattribute.ImmutableOperationwithKey(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thekeyattribute.ImmutableOperationwithSession(java.lang.String value)Copy the current immutable object by setting a present value for the optionalsessionattribute.ImmutableOperationwithSession(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thesessionattribute.ImmutableOperationwithValue(java.lang.String value)Copy the current immutable object by setting a present value for the optionalvalueattribute.ImmutableOperationwithValue(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thevalueattribute.ImmutableOperationwithVerb(java.lang.String value)Copy the current immutable object by setting a value for theverbattribute.
-
-
-
Method Detail
-
verb
public java.lang.String verb()
-
key
public java.util.Optional<java.lang.String> key()
-
value
public java.util.Optional<java.lang.String> value()
-
flags
public java.util.Optional<java.lang.Long> flags()
-
index
public java.util.Optional<java.math.BigInteger> index()
-
session
public java.util.Optional<java.lang.String> session()
-
withVerb
public final ImmutableOperation withVerb(java.lang.String value)
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
public final ImmutableOperation withKey(java.lang.String value)
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
public final ImmutableOperation withKey(java.util.Optional<java.lang.String> optional)
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
public final ImmutableOperation withValue(java.lang.String value)
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
public final ImmutableOperation withValue(java.util.Optional<java.lang.String> optional)
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
public final ImmutableOperation withFlags(long value)
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
public final ImmutableOperation withFlags(java.util.Optional<java.lang.Long> optional)
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
public final ImmutableOperation withIndex(java.math.BigInteger value)
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
public final ImmutableOperation withIndex(java.util.Optional<? extends java.math.BigInteger> optional)
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
public final ImmutableOperation withSession(java.lang.String value)
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
public final ImmutableOperation withSession(java.util.Optional<java.lang.String> optional)
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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableOperationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:verb,key,value,flags,index,session.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueOperationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableOperation copyOf(Operation instance)
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
public static ImmutableOperation.Builder 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
-
-