@ParametersAreNonnullByDefault @Generated(value={"Immutables.generator","Value"}) @Immutable public final class ImmutableValue extends Value
Value.
Use the builder to create immutable instances:
ImmutableValue.builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableValue.Builder
Builds instances of type
ImmutableValue. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableValue.Builder |
builder()
Creates a builder for
ImmutableValue. |
static ImmutableValue |
copyOf(Value instance)
Creates an immutable copy of a
Value value. |
boolean |
equals(Object another)
This instance is equal to all instances of
ImmutableValue that have equal attribute values. |
long |
getCreateIndex() |
long |
getFlags() |
String |
getKey() |
long |
getLockIndex() |
long |
getModifyIndex() |
Optional<String> |
getSession() |
Optional<String> |
getValue() |
Optional<String> |
getValueAsString() |
int |
hashCode()
Computes a hash code from attributes:
createIndex, modifyIndex, lockIndex, key, flags, value, session. |
String |
toString()
Prints the immutable value
Value with attribute values. |
ImmutableValue |
withCreateIndex(long value)
Copy the current immutable object by setting a value for the
createIndex attribute. |
ImmutableValue |
withFlags(long value)
Copy the current immutable object by setting a value for the
flags attribute. |
ImmutableValue |
withKey(String value)
Copy the current immutable object by setting a value for the
key attribute. |
ImmutableValue |
withLockIndex(long value)
Copy the current immutable object by setting a value for the
lockIndex attribute. |
ImmutableValue |
withModifyIndex(long value)
Copy the current immutable object by setting a value for the
modifyIndex attribute. |
ImmutableValue |
withSession(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
session attribute. |
ImmutableValue |
withSession(String value)
Copy the current immutable object by setting a present value for the optional
session attribute. |
ImmutableValue |
withValue(Optional<String> optional)
Copy the current immutable object by setting an optional value for the
value attribute. |
ImmutableValue |
withValue(String value)
Copy the current immutable object by setting a present value for the optional
value attribute. |
getValueAsStringpublic long getCreateIndex()
getCreateIndex in class ValuecreateIndex attributepublic long getModifyIndex()
getModifyIndex in class ValuemodifyIndex attributepublic long getLockIndex()
getLockIndex in class ValuelockIndex attributepublic String getKey()
public long getFlags()
public Optional<String> getSession()
getSession in class Valuesession attributepublic final ImmutableValue withCreateIndex(long value)
createIndex attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for createIndexthis objectpublic final ImmutableValue withModifyIndex(long value)
modifyIndex attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for modifyIndexthis objectpublic final ImmutableValue withLockIndex(long value)
lockIndex attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for lockIndexthis objectpublic final ImmutableValue withKey(String value)
key attribute.
An equals check used to prevent copying of the same value by returning this.value - A new value for keythis objectpublic final ImmutableValue withFlags(long value)
flags attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for flagsthis objectpublic final ImmutableValue withValue(String value)
value attribute.value - The value for valuethis objectpublic final ImmutableValue withValue(Optional<String> optional)
value attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for valuethis objectpublic final ImmutableValue withSession(String value)
session attribute.value - The value for sessionthis objectpublic final ImmutableValue withSession(Optional<String> optional)
session attribute.
An equality check is used on inner nullable value to prevent copying of the same value by returning this.optional - A value for sessionthis objectpublic boolean equals(@Nullable Object another)
ImmutableValue that have equal attribute values.public int hashCode()
createIndex, modifyIndex, lockIndex, key, flags, value, session.public String toString()
Value with attribute values.public Optional<String> getValueAsString()
Returns a lazily initialized value of the valueAsString attribute.
Initialized once and only once and stored for subsequent access with proper synchronization.
getValueAsString in class Valuel.name attributepublic static ImmutableValue copyOf(Value instance)
Value value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static ImmutableValue.Builder builder()
ImmutableValue.Copyright © 2018. All rights reserved.