Class EmptyAttributes
java.lang.Object
com.yworkflow.definition.model.attribute.EmptyAttributes
- All Implemented Interfaces:
Attributes,MutableAttributes
Empty attributes to use when Null Object is needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) Checks if an attribute with the specified key exists.Gets an attribute value as an Object.getBoolean(String key) Gets a boolean attribute value.Optional<byte[]> Gets a binary data attribute value.Gets a double attribute value.Gets the complete attribute entry for a key.getInstant(String key) Gets an Instant attribute value.Gets an integer attribute value.getKeys()Gets all attribute keys.getKeys(AttributeType<?> type) Gets all attribute keys of the specified type.Gets all attribute keys with the specified prefix.getKeys(String prefix, AttributeType<?> type) Gets all attribute keys with the specified prefix and type.Gets a long attribute value.Gets an object attribute value.Gets a string attribute value.Gets the type of attribute.voidremove()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.toMap()Converts this Attributes instance to a Map representation.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.
-
Constructor Details
-
EmptyAttributes
public EmptyAttributes()Default Constructor.
-
-
Method Details
-
get
Description copied from interface:AttributesGets an attribute value as an Object. This method returns the raw value without type checking.- Specified by:
getin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the attribute value if found, empty otherwise
-
getBoolean
Description copied from interface:AttributesGets a boolean attribute value.- Specified by:
getBooleanin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the boolean value if found and type matches, empty otherwise
-
getData
Description copied from interface:AttributesGets a binary data attribute value.- Specified by:
getDatain interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the byte array if found and type matches, empty otherwise
-
getInstant
Description copied from interface:AttributesGets an Instant attribute value.- Specified by:
getInstantin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the Instant if found and type matches, empty otherwise
-
getDouble
Description copied from interface:AttributesGets a double attribute value.- Specified by:
getDoublein interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the double value if found and type matches, empty otherwise
-
getInt
Description copied from interface:AttributesGets an integer attribute value.- Specified by:
getIntin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the integer value if found and type matches, empty otherwise
-
getKeys
Description copied from interface:AttributesGets all attribute keys.- Specified by:
getKeysin interfaceAttributes- Returns:
- a collection of all attribute keys
-
getKeys
Description copied from interface:AttributesGets all attribute keys of the specified type.- Specified by:
getKeysin interfaceAttributes- Parameters:
type- the attribute type to filter by- Returns:
- a collection of keys for attributes of the specified type
-
getKeys
Description copied from interface:AttributesGets all attribute keys with the specified prefix.- Specified by:
getKeysin interfaceAttributes- Parameters:
prefix- the prefix to filter by- Returns:
- a collection of keys that start with the specified prefix
-
getKeys
Description copied from interface:AttributesGets all attribute keys with the specified prefix and type.- Specified by:
getKeysin interfaceAttributes- Parameters:
prefix- the prefix to filter bytype- the attribute type to filter by- Returns:
- a collection of keys that start with the prefix and are of the specified type
-
getLong
Description copied from interface:AttributesGets a long attribute value.- Specified by:
getLongin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the long value if found and type matches, empty otherwise
-
getObject
Description copied from interface:AttributesGets an object attribute value.- Specified by:
getObjectin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the object value if found and type matches, empty otherwise
-
getString
Description copied from interface:AttributesGets a string attribute value.- Specified by:
getStringin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the string value if found and type matches, empty otherwise
-
getType
Description copied from interface:AttributesGets the type of attribute.- Specified by:
getTypein interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the attribute type if the key exists, empty otherwise
-
getEntry
Description copied from interface:AttributesGets the complete attribute entry for a key.- Specified by:
getEntryin interfaceAttributes- Parameters:
key- the attribute key- Returns:
- an Optional containing the attribute entry if found, empty otherwise
-
containsKey
Description copied from interface:AttributesChecks if an attribute with the specified key exists.- Specified by:
containsKeyin interfaceAttributes- Parameters:
key- the attribute key to check- Returns:
- true if the key exists, false otherwise
-
toMap
Description copied from interface:AttributesConverts this Attributes instance to a Map representation. Only attributes with non-null values are included in the resulting map.- Specified by:
toMapin interfaceAttributes- Returns:
- a Map containing the attribute key-value pairs
-
setBoolean
Description copied from interface:MutableAttributesSets a boolean attribute value.- Specified by:
setBooleanin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the boolean value to set
-
withBoolean
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified boolean value.- Specified by:
withBooleanin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the boolean value to set- Returns:
- a new MutableAttributes instance with the boolean value
-
setData
Description copied from interface:MutableAttributesSets a binary data attribute value.- Specified by:
setDatain interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the byte array value to set
-
withData
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified binary data value.- Specified by:
withDatain interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the byte array value to set- Returns:
- a new MutableAttributes instance with the binary data value
-
setInstant
Description copied from interface:MutableAttributesSets an Instant attribute value.- Specified by:
setInstantin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the Instant value to set
-
withInstant
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified Instant value.- Specified by:
withInstantin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the Instant value to set- Returns:
- a new MutableAttributes instance with the Instant value
-
setDouble
Description copied from interface:MutableAttributesSets a double attribute value.- Specified by:
setDoublein interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the double value to set
-
withDouble
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified double value.- Specified by:
withDoublein interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the double value to set- Returns:
- a new MutableAttributes instance with the double value
-
setInt
Description copied from interface:MutableAttributesSets an integer attribute value.- Specified by:
setIntin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the integer value to set
-
withInt
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified integer value.- Specified by:
withIntin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the integer value to set- Returns:
- a new MutableAttributes instance with the integer value
-
setLong
Description copied from interface:MutableAttributesSets a long attribute value.- Specified by:
setLongin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the long value to set
-
withLong
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified long value.- Specified by:
withLongin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the long value to set- Returns:
- a new MutableAttributes instance with the long value
-
setObject
Description copied from interface:MutableAttributesSets an object attribute value.- Specified by:
setObjectin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the object value to set
-
withObject
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified object value.- Specified by:
withObjectin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the object value to set- Returns:
- a new MutableAttributes instance with the object value
-
setString
Description copied from interface:MutableAttributesSets a string attribute value.- Specified by:
setStringin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the string value to set
-
withString
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with the specified string value.- Specified by:
withStringin interfaceMutableAttributes- Parameters:
key- the attribute keyvalue- the string value to set- Returns:
- a new MutableAttributes instance with the string value
-
setAttributes
Description copied from interface:MutableAttributesSets all attributes from another MutableAttributes instance.- Specified by:
setAttributesin interfaceMutableAttributes- Parameters:
other- the other MutableAttributes instance to copy from
-
withAttributes
Description copied from interface:MutableAttributesCreates a new MutableAttributes instance with all attributes from another instance.- Specified by:
withAttributesin interfaceMutableAttributes- Parameters:
other- the other MutableAttributes instance to copy from- Returns:
- a new MutableAttributes instance with all attributes from the other instance
-
remove
Description copied from interface:MutableAttributesRemoves the attribute with the specified key.- Specified by:
removein interfaceMutableAttributes- Parameters:
key- the key of the attribute to remove
-
remove
public void remove()Description copied from interface:MutableAttributesRemoves all attributes from this instance.- Specified by:
removein interfaceMutableAttributes
-
toImmutable
Description copied from interface:MutableAttributesConverts this MutableAttributes instance to an ImmutableAttributes instance. This is useful for passing attributes to workflow operations that require immutable data.- Specified by:
toImmutablein interfaceMutableAttributes- Returns:
- an ImmutableAttributes instance containing all attributes from this instance
-