Interface Attributes

All Known Subinterfaces:
MutableAttributes
All Known Implementing Classes:
EmptyAttributes

public interface Attributes
Base interface for accessing workflow attributes. Attributes represent the data associated with workflow instances and can include various types of information such as user inputs, computed values, and system metadata.
Since:
1.0
See Also:
  • Method Details

    • get

      Optional<Object> get(String key)
      Gets an attribute value as an Object. This method returns the raw value without type checking.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the attribute value if found, empty otherwise
    • getBoolean

      Optional<Boolean> getBoolean(String key)
      Gets a boolean attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the boolean value if found and type matches, empty otherwise
    • getData

      Optional<byte[]> getData(String key)
      Gets a binary data attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the byte array if found and type matches, empty otherwise
    • getInstant

      Optional<Instant> getInstant(String key)
      Gets an Instant attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the Instant if found and type matches, empty otherwise
    • getDouble

      Optional<Double> getDouble(String key)
      Gets a double attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the double value if found and type matches, empty otherwise
    • getInt

      Optional<Integer> getInt(String key)
      Gets an integer attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the integer value if found and type matches, empty otherwise
    • getKeys

      Collection<String> getKeys()
      Gets all attribute keys.
      Returns:
      a collection of all attribute keys
    • getKeys

      Collection<String> getKeys(AttributeType<?> type)
      Gets all attribute keys of the specified type.
      Parameters:
      type - the attribute type to filter by
      Returns:
      a collection of keys for attributes of the specified type
    • getKeys

      Collection<String> getKeys(String prefix)
      Gets all attribute keys with the specified prefix.
      Parameters:
      prefix - the prefix to filter by
      Returns:
      a collection of keys that start with the specified prefix
    • getKeys

      Collection<String> getKeys(String prefix, AttributeType<?> type)
      Gets all attribute keys with the specified prefix and type.
      Parameters:
      prefix - the prefix to filter by
      type - the attribute type to filter by
      Returns:
      a collection of keys that start with the prefix and are of the specified type
    • getLong

      Optional<Long> getLong(String key)
      Gets a long attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the long value if found and type matches, empty otherwise
    • getObject

      Optional<Object> getObject(String key)
      Gets an object attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the object value if found and type matches, empty otherwise
    • getString

      Optional<String> getString(String key)
      Gets a string attribute value.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the string value if found and type matches, empty otherwise
    • getType

      Optional<AttributeType<?>> getType(String key)
      Gets the type of attribute.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the attribute type if the key exists, empty otherwise
    • getEntry

      Optional<AttributeEntry<?>> getEntry(String key)
      Gets the complete attribute entry for a key.
      Parameters:
      key - the attribute key
      Returns:
      an Optional containing the attribute entry if found, empty otherwise
    • containsKey

      boolean containsKey(String key)
      Checks if an attribute with the specified key exists.
      Parameters:
      key - the attribute key to check
      Returns:
      true if the key exists, false otherwise
    • toMap

      Map<String,Object> toMap()
      Converts this Attributes instance to a Map representation. Only attributes with non-null values are included in the resulting map.
      Returns:
      a Map containing the attribute key-value pairs
    • empty

      static Attributes empty()
      Creates a new empty ImmutableAttributes instance.
      Returns:
      a new empty ImmutableAttributes instance