Syntax

	resolveEnum($type, $name)

Description

Resolves a Java enum constant by the fully qualified class name type of the enum and its serialized name name. The serialized name is the name used in configuration files (XML, JSON). This is the inverse operation of enumName().

Parameters

Name Type Description Mandatory Default
type String The fully qualified Java class name of the enum type. yes
name String The serialized name of the enum constant to resolve. yes

Return value

Type: Enum

The enum constant of type type with the serialized name name.

Examples

Resolve an enum constant by name

resolveEnum("com.top_logic.basic.config.MapOperation", "add")

Output: MapOperation.ADD

Resolves the MapOperation enum constant with serialized name "add".

Round-trip with enumName()

enumName(resolveEnum("com.top_logic.basic.config.MapOperation", "add"))

Output: "add"