Package io.dialob.program.model
Class ImmutableValueSet.Entry
- java.lang.Object
-
- io.dialob.program.model.ImmutableValueSet.Entry
-
- All Implemented Interfaces:
ProgramNode,ValueSet.Entry,Serializable
- Enclosing class:
- ImmutableValueSet
@Immutable @CheckReturnValue public static final class ImmutableValueSet.Entry extends Object implements ValueSet.Entry
Immutable implementation ofValueSet.Entry.Use the builder to create immutable instances:
ImmutableValueSet.Entry.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableValueSet.Entry.BuilderBuilds instances of typeEntry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableValueSet.Entry.Builderbuilder()Creates a builder forEntry.static ImmutableValueSet.EntrycopyOf(ValueSet.Entry instance)Creates an immutable copy of aValueSet.Entryvalue.booleanequals(Object another)This instance is equal to all instances ofEntrythat have equal attribute values.StringgetKey()ExpressiongetLabel()inthashCode()Computes a hash code from attributes:key,label.StringtoString()Prints the immutable valueEntrywith attribute values.ImmutableValueSet.EntrywithKey(String value)Copy the current immutable object by setting a value for thekeyattribute.ImmutableValueSet.EntrywithLabel(Expression value)Copy the current immutable object by setting a value for thelabelattribute.
-
-
-
Method Detail
-
getKey
public String getKey()
- Specified by:
getKeyin interfaceValueSet.Entry- Returns:
- The value of the
keyattribute
-
getLabel
public Expression getLabel()
- Specified by:
getLabelin interfaceValueSet.Entry- Returns:
- The value of the
labelattribute
-
withKey
public final ImmutableValueSet.Entry 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
-
withLabel
public final ImmutableValueSet.Entry withLabel(Expression value)
Copy the current immutable object by setting a value for thelabelattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for label- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofEntrythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:key,label.
-
toString
public String toString()
Prints the immutable valueEntrywith attribute values.
-
copyOf
public static ImmutableValueSet.Entry copyOf(ValueSet.Entry instance)
Creates an immutable copy of aValueSet.Entryvalue. 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 Entry instance
-
builder
public static ImmutableValueSet.Entry.Builder builder()
Creates a builder forEntry.ImmutableValueSet.Entry.builder() .key(String) // requiredkey.label(io.dialob.program.model.Expression) // requiredlabel.build();- Returns:
- A new Entry builder
-
-