Package io.dialob.executor.command
Class ImmutableSetVariableValue
- java.lang.Object
-
- io.dialob.executor.command.ImmutableSetVariableValue
-
- All Implemented Interfaces:
AbstractUpdateCommand<ItemId,ItemState>,Command<ItemState>,ItemUpdateCommand,SetVariableValue,UpdateCommand<ItemId,ItemState>,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableSetVariableValue extends Object implements SetVariableValue
Immutable implementation ofSetVariableValue.Use the builder to create immutable instances:
ImmutableSetVariableValue.builder(). Use the static factory method to create immutable instances:ImmutableSetVariableValue.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableSetVariableValue.BuilderBuilds instances of typeImmutableSetVariableValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableSetVariableValue.Builderbuilder()Creates a builder forImmutableSetVariableValue.static ImmutableSetVariableValuecopyOf(SetVariableValue instance)Creates an immutable copy of aSetVariableValuevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableSetVariableValuethat have equal attribute values.ItemIdgetTargetId()com.google.common.collect.ImmutableList<Trigger<ItemState>>getTriggers()ObjectgetValue()inthashCode()Computes a hash code from attributes:triggers,targetId,value.static ImmutableSetVariableValueof(ItemId targetId, Object value, Iterable<? extends Trigger<ItemState>> triggers)Construct a new immutableSetVariableValueinstance.static ImmutableSetVariableValueof(ItemId targetId, Object value, List<Trigger<ItemState>> triggers)Construct a new immutableSetVariableValueinstance.StringtoString()Prints the immutable valueSetVariableValuewith attribute values.ImmutableSetVariableValuewithTargetId(ItemId value)Copy the current immutable object by setting a value for thetargetIdattribute.ImmutableSetVariableValuewithTriggers(Trigger<ItemState>... elements)Copy the current immutable object with elements that replace the content oftriggers.ImmutableSetVariableValuewithTriggers(Iterable<? extends Trigger<ItemState>> elements)Copy the current immutable object with elements that replace the content oftriggers.ImmutableSetVariableValuewithValue(Object value)Copy the current immutable object by setting a value for thevalueattribute.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.dialob.executor.command.Command
getEventMatchers
-
Methods inherited from interface io.dialob.executor.command.SetVariableValue
update
-
-
-
-
Method Detail
-
getTriggers
public com.google.common.collect.ImmutableList<Trigger<ItemState>> getTriggers()
- Specified by:
getTriggersin interfaceCommand<ItemState>- Returns:
- The value of the
triggersattribute
-
getTargetId
public ItemId getTargetId()
- Specified by:
getTargetIdin interfaceUpdateCommand<ItemId,ItemState>- Returns:
- The value of the
targetIdattribute
-
getValue
@Nullable public Object getValue()
- Specified by:
getValuein interfaceSetVariableValue- Returns:
- The value of the
valueattribute
-
withTriggers
@SafeVarargs public final ImmutableSetVariableValue withTriggers(Trigger<ItemState>... elements)
Copy the current immutable object with elements that replace the content oftriggers.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTriggers
public final ImmutableSetVariableValue withTriggers(Iterable<? extends Trigger<ItemState>> elements)
Copy the current immutable object with elements that replace the content oftriggers. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of triggers elements to set- Returns:
- A modified copy of
thisobject
-
withTargetId
public final ImmutableSetVariableValue withTargetId(ItemId value)
Copy the current immutable object by setting a value for thetargetIdattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Specified by:
withTargetIdin interfaceUpdateCommand<ItemId,ItemState>- Parameters:
value- A new value for targetId- Returns:
- A modified copy of the
thisobject
-
withValue
public final ImmutableSetVariableValue withValue(@Nullable Object value)
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableSetVariableValuethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:triggers,targetId,value.
-
toString
public String toString()
Prints the immutable valueSetVariableValuewith attribute values.
-
of
public static ImmutableSetVariableValue of(ItemId targetId, @Nullable Object value, List<Trigger<ItemState>> triggers)
Construct a new immutableSetVariableValueinstance.- Parameters:
targetId- The value for thetargetIdattributevalue- The value for thevalueattributetriggers- The value for thetriggersattribute- Returns:
- An immutable SetVariableValue instance
-
of
public static ImmutableSetVariableValue of(ItemId targetId, @Nullable Object value, Iterable<? extends Trigger<ItemState>> triggers)
Construct a new immutableSetVariableValueinstance.- Parameters:
targetId- The value for thetargetIdattributevalue- The value for thevalueattributetriggers- The value for thetriggersattribute- Returns:
- An immutable SetVariableValue instance
-
copyOf
public static ImmutableSetVariableValue copyOf(SetVariableValue instance)
Creates an immutable copy of aSetVariableValuevalue. 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 SetVariableValue instance
-
builder
public static ImmutableSetVariableValue.Builder builder()
Creates a builder forImmutableSetVariableValue.ImmutableSetVariableValue.builder() .addTriggers|addAllTriggers(io.dialob.executor.command.Trigger<io.dialob.executor.model.ItemState>) //triggerselements .targetId(io.dialob.executor.model.ItemId) // requiredtargetId.value(Object | null) // nullablevalue.build();- Returns:
- A new ImmutableSetVariableValue builder
-
-