hutcheb commented on a change in pull request #230:
URL: https://github.com/apache/plc4x/pull/230#discussion_r603120355



##########
File path: 
build-utils/language-java/src/main/resources/templates/java/enum-template.ftlh
##########
@@ -59,7 +59,7 @@ import java.util.Map;
 public enum ${type.name} {
 
 <#list type.enumValues as enumValue>
-    ${enumValue.name}(<#if 
type.type?has_content>(${helper.getLanguageTypeNameForTypeReference(type.type, 
true)}) <#if 
helper.isStringTypeReference(type.type)>"${enumValue.value}"<#else>${enumValue.value}</#if></#if><#if
 type.constantNames?has_content><#if type.type?has_content>, </#if><#list 
type.constantNames as 
constantName>(${helper.getLanguageTypeNameForTypeReference(type.getConstantType(constantName),
 true)}) ${helper.escapeValue(type.getConstantType(constantName), 
enumValue.getConstant(constantName))}<#sep>, </#sep></#list></#if>)<#sep>,
+    ${enumValue.name}(<#if 
type.type?has_content>(${helper.getLanguageTypeNameForTypeReference(type.type, 
true)}) <#if 
helper.isStringTypeReference(type.type)>"${enumValue.value}"<#elseif 
helper.isComplexTypeReference(type.type)><#if 
helper.isEnumTypeReference(type.type)>${helper.getLanguageTypeNameForTypeReference(type.type,
 
true)}.${enumValue.value}<#else>${enumValue.value}</#if><#else>${enumValue.value}</#if></#if><#if
 type.constantNames?has_content><#if type.type?has_content>, </#if><#list 
type.constantNames as constantName><#if 
helper.isComplexTypeReference(type.getConstantType(constantName))><#if 
helper.escapeValue(type.getConstantType(constantName), 
enumValue.getConstant(constantName)) == 'null'>null<#elseif 
helper.isEnumTypeReference(type.getConstantType(constantName))>${helper.getLanguageTypeNameForTypeReference(type.getConstantType(constantName),
 true)}.${helper.escapeValue(type.getConstantType(constantName), 
enumValue.getConstant(constantName))}<#else>(${helper.getLanguag
 eTypeNameForTypeReference(type.getConstantType(constantName), true)}) 
${helper.escapeValue(type.getConstantType(constantName), 
enumValue.getConstant(constantName))}</#if><#else>(${helper.getLanguageTypeNameForTypeReference(type.getConstantType(constantName),
 true)}) ${helper.escapeValue(type.getConstantType(constantName), 
enumValue.getConstant(constantName))}</#if><#sep>, </#sep></#list></#if>)<#sep>,

Review comment:
       Yeah these long line suck.
   
   I'm guessing we would probably have to implement a helper function or there 
looks like the might be a <#compress> directive that might be helpful. Let me 
check.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to