Package io.serverlessworkflow.api
Enum Class WorkflowFormat
- All Implemented Interfaces:
Serializable,Comparable<WorkflowFormat>,Constable
Enum representing the supported formats for Serverless Workflow definitions.
Provides utility methods to determine the format based on file name or path, and to access the
corresponding ObjectMapper for serialization and deserialization.
-
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 TypeMethodDescriptionstatic WorkflowFormatfromFileName(String fileName) Determines theWorkflowFormatfrom a file name by inspecting its extension.static WorkflowFormatDetermines theWorkflowFormatfrom a file path by inspecting its file extension.com.fasterxml.jackson.databind.ObjectMappermapper()Returns theObjectMapperassociated with this workflow format.static WorkflowFormatReturns the enum constant of this class with the specified name.static WorkflowFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
JSON
JSON format for workflow definitions. -
YAML
YAML format for workflow definitions.
-
-
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
-
fromPath
Determines theWorkflowFormatfrom a file path by inspecting its file extension.- Parameters:
path- the file path to inspect- Returns:
- the corresponding
WorkflowFormat
-
fromFileName
Determines theWorkflowFormatfrom a file name by inspecting its extension. ReturnsJSONif the file name ends with ".json", otherwise returnsYAML.- Parameters:
fileName- the file name to inspect- Returns:
- the corresponding
WorkflowFormat
-
mapper
public com.fasterxml.jackson.databind.ObjectMapper mapper()Returns theObjectMapperassociated with this workflow format.- Returns:
- the object mapper for this format
-