public boolean hasFieldOfType(String fieldTypeName) {
        Objects.requireNonNull(fieldTypeName);
        if (thisType instanceof ComplexTypeDefinition) {
            ComplexTypeDefinition complexTypeDefinition = (ComplexTypeDefinition) this.thisType;
            return complexTypeDefinition.getFields().stream()
                .anyMatch(field -> fieldTypeName.equals(field.getTypeName()));
        }
        return false;
    }
Enums are always based on a main type. This helper accesses this information in a safe manner.

@param typeReference type reference
@return simple type reference for the enum type referenced by the given type reference
code-generation/language-base-freemarker/src/main/java/org/apache/plc4x/plugins/codegenerator/protocol/freemarker/BaseFreemarkerLanguageTemplateHelper.java