Enum Class ActionType
- All Implemented Interfaces:
Serializable,Comparable<ActionType>,Constable
Represents the type of action to be performed on a business object.
This enum defines the valid actions (INSERT, UPDATE, DELETE) and provides validation logic for each based on the presence and format of a persistence ID. This approach centralizes business rules, making the code more robust and easier to maintain.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionRetrieves all process instance states as a read-only Map where the key is the technical key and the value is the description.Retrieves all technical keys as a read-only List of Strings.Returns the business description of this criticality type.getKey()Returns the unique string key associated with this criticality type.abstract booleanValidates a persistence ID string against the requirements of the specific action type.static ActionTypeReturns the enum constant of this class with the specified name.static ActionType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSERT
Represents the creation of a new business object.For an INSERT action, a valid persistence ID string must be empty.
-
UPDATE
Represents the modification of an existing business object.For an UPDATE action, a valid persistence ID string must be non-empty and contain only digits.
-
DELETE
Represents the deletion of an existing business object.For a DELETE action, a valid persistence ID string must be non-empty and contain only digits.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getKey
Returns the unique string key associated with this criticality type.- Returns:
- The criticality key (e.g., "High").
-
getDescription
Returns the business description of this criticality type.- Returns:
- The description.
-
isValid
Validates a persistence ID string against the requirements of the specific action type.- Parameters:
persistenceId- The string representation of the business object's persistence ID.- Returns:
trueif the persistence ID is valid for the current action type, otherwisefalse.
-
getAllData
Retrieves all process instance states as a read-only Map where the key is the technical key and the value is the description.- Returns:
- A map containing all process state data (Key -> Description).
-
getAllKeysList
Retrieves all technical keys as a read-only List of Strings.- Returns:
- A list containing all technical keys.
-