Package com.yworkflow.definition.model
Interface MutableAttributes
- All Superinterfaces:
Attributes
- All Known Implementing Classes:
EmptyAttributes
Provides mutable access to workflow attributes. MutableAttributes extends the base Attributes
interface to add methods for setting, updating, and removing attribute values. This interface is
used for building and modifying workflow data during execution.
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidremove()Removes all attributes from this instance.voidRemoves the attribute with the specified key.voidsetAttributes(MutableAttributes other) Sets all attributes from another MutableAttributes instance.voidsetBoolean(String key, boolean value) Sets a boolean attribute value.voidSets a binary data attribute value.voidSets a double attribute value.voidsetInstant(String key, Instant value) Sets an Instant attribute value.voidSets an integer attribute value.voidSets a long attribute value.voidSets an object attribute value.voidSets a string attribute value.Converts this MutableAttributes instance to an ImmutableAttributes instance.withAttributes(MutableAttributes other) Creates a new MutableAttributes instance with all attributes from another instance.withBoolean(String key, boolean value) Creates a new MutableAttributes instance with the specified boolean value.Creates a new MutableAttributes instance with the specified binary data value.withDouble(String key, double value) Creates a new MutableAttributes instance with the specified double value.withInstant(String key, Instant value) Creates a new MutableAttributes instance with the specified Instant value.Creates a new MutableAttributes instance with the specified integer value.Creates a new MutableAttributes instance with the specified long value.withObject(String key, Object value) Creates a new MutableAttributes instance with the specified object value.withString(String key, String value) Creates a new MutableAttributes instance with the specified string value.Methods inherited from interface com.yworkflow.definition.model.Attributes
containsKey, get, getBoolean, getData, getDouble, getEntry, getInstant, getInt, getKeys, getKeys, getKeys, getKeys, getLong, getObject, getString, getType, toMap
-
Method Details
-
setBoolean
Sets a boolean attribute value.- Parameters:
key- the attribute keyvalue- the boolean value to set
-
withBoolean
Creates a new MutableAttributes instance with the specified boolean value.- Parameters:
key- the attribute keyvalue- the boolean value to set- Returns:
- a new MutableAttributes instance with the boolean value
-
setData
Sets a binary data attribute value.- Parameters:
key- the attribute keyvalue- the byte array value to set
-
withData
Creates a new MutableAttributes instance with the specified binary data value.- Parameters:
key- the attribute keyvalue- the byte array value to set- Returns:
- a new MutableAttributes instance with the binary data value
-
setInstant
Sets an Instant attribute value.- Parameters:
key- the attribute keyvalue- the Instant value to set
-
withInstant
Creates a new MutableAttributes instance with the specified Instant value.- Parameters:
key- the attribute keyvalue- the Instant value to set- Returns:
- a new MutableAttributes instance with the Instant value
-
setDouble
Sets a double attribute value.- Parameters:
key- the attribute keyvalue- the double value to set
-
withDouble
Creates a new MutableAttributes instance with the specified double value.- Parameters:
key- the attribute keyvalue- the double value to set- Returns:
- a new MutableAttributes instance with the double value
-
setInt
Sets an integer attribute value.- Parameters:
key- the attribute keyvalue- the integer value to set
-
withInt
Creates a new MutableAttributes instance with the specified integer value.- Parameters:
key- the attribute keyvalue- the integer value to set- Returns:
- a new MutableAttributes instance with the integer value
-
setLong
Sets a long attribute value.- Parameters:
key- the attribute keyvalue- the long value to set
-
withLong
Creates a new MutableAttributes instance with the specified long value.- Parameters:
key- the attribute keyvalue- the long value to set- Returns:
- a new MutableAttributes instance with the long value
-
setObject
Sets an object attribute value.- Parameters:
key- the attribute keyvalue- the object value to set
-
withObject
Creates a new MutableAttributes instance with the specified object value.- Parameters:
key- the attribute keyvalue- the object value to set- Returns:
- a new MutableAttributes instance with the object value
-
setString
Sets a string attribute value.- Parameters:
key- the attribute keyvalue- the string value to set
-
withString
Creates a new MutableAttributes instance with the specified string value.- Parameters:
key- the attribute keyvalue- the string value to set- Returns:
- a new MutableAttributes instance with the string value
-
setAttributes
Sets all attributes from another MutableAttributes instance.- Parameters:
other- the other MutableAttributes instance to copy from
-
withAttributes
Creates a new MutableAttributes instance with all attributes from another instance.- Parameters:
other- the other MutableAttributes instance to copy from- Returns:
- a new MutableAttributes instance with all attributes from the other instance
-
remove
Removes the attribute with the specified key.- Parameters:
key- the key of the attribute to remove
-
remove
void remove()Removes all attributes from this instance. -
toImmutable
Attributes toImmutable()Converts this MutableAttributes instance to an ImmutableAttributes instance. This is useful for passing attributes to workflow operations that require immutable data.- Returns:
- an ImmutableAttributes instance containing all attributes from this instance
-