public SimpleTypeReference getEnumFieldSimpleTypeReference(NonSimpleTypeReference type, String fieldName) {
        if (!(type.getTypeDefinition() instanceof EnumTypeDefinition)
            || !(((EnumTypeDefinition) type.getTypeDefinition()).getConstantType(fieldName) instanceof SimpleTypeReference)) {
            throw new IllegalArgumentException("not an enum type or enum constant is not a simple type");
        }
        return (SimpleTypeReference) ((EnumTypeDefinition) type.getTypeDefinition()).getConstantType(fieldName);
    }
Get a list of the types for every discriminator name.

@return Map mapping discriminator names to types.
code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/BaseFreemarkerLanguageTemplateHelper.java