मेरे अगर कथन में, मैं एक चर की तुलना करना चाहता हूं, जो एक जेडके 1.5 एनम है, जो कि एक एनम शाब्दिक है। उदाहरण के लिए:फ्रीमार्कर: अगर एक कथन में एक enum
<#if type == ProblemStatisticType.BEST_SOLUTION_CHANGED>
...
</#if>
लेकिन मैं इस अपवाद प्राप्त करें:
freemarker.core.InvalidReferenceException: Expression ProblemStatisticType is undefined on line 430, column 87 in index.html.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
मैं ऐसा कैसे कर सकता है?
यह काम करता है, लेकिन यह अनुकूल नहीं है। क्या होगा अगर enum toString() विधि को ओवरराइट करता है? –