Simplify dispatch of checking to a separate method.
Change-Id: I59e3baf22bf99ead66f43c7df0fd62ab2b030894
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
«ELSEIF EMPTY_TYPE.equals(propRet) || EMPTY_TYPE.equals(propRet.typedefReturnType)»
««« generated empty typedef
return "";
«ELSEIF EMPTY_TYPE.equals(propRet) || EMPTY_TYPE.equals(propRet.typedefReturnType)»
««« generated empty typedef
return "";
- «ELSEIF propRet instanceof GeneratedTransferObject // Is it a GeneratedTransferObject
- && (propRet as GeneratedTransferObject).typedef // Is it a typedef
- && (propRet as GeneratedTransferObject).baseType instanceof BitsTypeDefinition»
+ «ELSEIF propRet.isBitsType»
««« generated bits typedef
return «JU_ARRAYS.importedName».toString(«field».getValue());
«ELSE»
««« generated bits typedef
return «JU_ARRAYS.importedName».toString(«field».getValue());
«ELSE»
+ private static def isBitsType(Type type) {
+ if (type instanceof GeneratedTransferObject) {
+ return type.typedef && type.baseType instanceof BitsTypeDefinition
+ }
+ return false
+ }
+
private static def Type typedefReturnType(Type type) {
if (!(type instanceof GeneratedTransferObject)) {
return null
private static def Type typedefReturnType(Type type) {
if (!(type instanceof GeneratedTransferObject)) {
return null