Class ProtoEnumNameUtils
java.lang.Object
io.temporal.internal.common.ProtoEnumNameUtils
Because in Go enums are in a shared namespace, one of protobuf common practices is to prefix the
enums with enum name prefix to create unique names. The final result is verbose and when we use a
string representation of some enum in different parts of the system (history json or search
attribute types), we use a short version without prefix in camel case. So, protobuf enum
EventType.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED gets converted to
"WorkflowExecutionStarted"
AIP 126
- The other values should not be prefixed by the name of the enum itself. This generally requires
users to write MyState.MYSTATE_ACTIVE in their code, which is unnecessarily verbose. - To avoid
sharing values, APIs may prefix enum values with the name of the enum. In this case, they must do
so consistently within the enum.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringsimplifiedToUniqueName(String enumName, String prefix) static StringuniqueToSimplifiedName(Enum<?> enumm) static StringuniqueToSimplifiedName(String protoEnumName, String prefix)
-
Field Details
-
WORKFLOW_TASK_FAILED_CAUSE_PREFIX
- See Also:
-
INDEXED_VALUE_TYPE_PREFIX
- See Also:
-
COMMAND_TYPE_PREFIX
- See Also:
-
EVENT_TYPE_PREFIX
- See Also:
-
ENUM_CLASS_TO_PREFIX
-
-
Constructor Details
-
ProtoEnumNameUtils
public ProtoEnumNameUtils()
-
-
Method Details
-
uniqueToSimplifiedName
-
uniqueToSimplifiedName
-
simplifiedToUniqueName
-