Class ImmutableKeyValue
- java.lang.Object
-
- com.chutneytesting.server.core.domain.tools.ui.ImmutableKeyValue
-
- All Implemented Interfaces:
KeyValue
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableKeyValue extends Object implements KeyValue
Immutable implementation ofKeyValue.Use the builder to create immutable instances:
ImmutableKeyValue.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableKeyValue.BuilderBuilds instances of typeImmutableKeyValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableKeyValue.Builderbuilder()Creates a builder forImmutableKeyValue.static ImmutableKeyValuecopyOf(KeyValue instance)Creates an immutable copy of aKeyValuevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableKeyValuethat have equal attribute values.inthashCode()Computes a hash code from attributes:key,value.Stringkey()StringtoString()Prints the immutable valueKeyValuewith attribute values.Stringvalue()ImmutableKeyValuewithKey(String value)Copy the current immutable object by setting a value for thekeyattribute.ImmutableKeyValuewithValue(String value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
key
public String key()
-
value
public String value()
-
withKey
public final ImmutableKeyValue withKey(String value)
Copy the current immutable object by setting a value for thekeyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for key- Returns:
- A modified copy of the
thisobject
-
withValue
public final ImmutableKeyValue withValue(String value)
Copy the current immutable object by setting a value for thevalueattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableKeyValuethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:key,value.
-
toString
public String toString()
Prints the immutable valueKeyValuewith attribute values.
-
copyOf
public static ImmutableKeyValue copyOf(KeyValue instance)
Creates an immutable copy of aKeyValuevalue. 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 KeyValue instance
-
builder
public static ImmutableKeyValue.Builder builder()
Creates a builder forImmutableKeyValue.ImmutableKeyValue.builder() .key(String) // requiredkey.value(String) // optionalvalue.build();- Returns:
- A new ImmutableKeyValue builder
-
-