Source:
public XmlQuestion(Question q) { text = q.getText(); id = q.getKey().getId(); order = q.getOrder(); mandatory = Boolean.TRUE == q.getMandatoryFlag(); localeNameFlag = Boolean.TRUE == q.getLocaleNameFlag(); if (Boolean.TRUE == q.getLocaleLocationFlag()) { localeLocationFlag = Boolean.TRUE; } if (Boolean.TRUE == q.getGeoLocked()) { locked = Boolean.TRUE; } if (q.getTip() != null) { help = new XmlHelp(q.getTip()); } type = q.getType().toString().toLowerCase(); switch (q.getType()) { case NUMBER: type = FREE_TYPE; validationRule = new XmlValidationRule(q); if (Boolean.TRUE == q.getRequireDoubleEntry()) { requireDoubleEntry = Boolean.TRUE; } break; case FREE_TEXT: type = FREE_TYPE; if (Boolean.TRUE == q.getRequireDoubleEntry()) { requireDoubleEntry = Boolean.TRUE; } break; case GEOSHAPE: allowPoints = Boolean.TRUE == q.getAllowPoints(); allowLine = Boolean.TRUE == q.getAllowLine(); allowPolygon = Boolean.TRUE == q.getAllowPolygon(); break; case CASCADE: cascadeResource = q.getCascadeResourceId().toString(); if (q.getLevelNames() != null) { level = new ArrayList<>(); for (String text: q.getLevelNames()) { level.add(new XmlLevel(text)); } } break; case CADDISFLY: caddisflyResourceUuid = q.getCaddisflyResourceUuid(); break; case OPTION: if (q.getQuestionOptionMap() != null) { options = new XmlOptions(q); } break; default: break; } if (Boolean.TRUE == q.getDependentFlag()) { dependency = new XmlDependency(q.getDependentQuestionId(), q.getDependentQuestionAnswer()); } if (q.getTranslationMap() != null) { altText = new ArrayList<>(); for (Translation t: q.getTranslationMap().values()) { altText.add(new XmlAltText(t)); } } }

Target:
public XmlQuestion(Question q) { text = q.getText(); id = q.getKey().getId(); order = q.getOrder(); mandatory = Boolean.TRUE.equals(q.getMandatoryFlag()); localeNameFlag = Boolean.TRUE.equals(q.getLocaleNameFlag()); if (Boolean.TRUE.equals(q.getLocaleLocationFlag())) { localeLocationFlag = Boolean.TRUE; } if (Boolean.TRUE.equals(q.getGeoLocked())) { locked = Boolean.TRUE; } if (q.getTip() != null) { help = new XmlHelp(q.getTip()); } type = q.getType().toString().toLowerCase(); switch (q.getType()) { case NUMBER: type = FREE_TYPE; validationRule = new XmlValidationRule(q); if (Boolean.TRUE.equals(q.getRequireDoubleEntry())) { requireDoubleEntry = Boolean.TRUE; } break; case FREE_TEXT: type = FREE_TYPE; if (Boolean.TRUE.equals(q.getRequireDoubleEntry())) { requireDoubleEntry = Boolean.TRUE; } break; case GEOSHAPE: allowPoints = Boolean.TRUE.equals(q.getAllowPoints()); allowLine = Boolean.TRUE.equals(q.getAllowLine()); allowPolygon = Boolean.TRUE.equals(q.getAllowPolygon()); break; case CASCADE: cascadeResource = q.getCascadeResourceId().toString(); if (q.getLevelNames() != null) { level = new ArrayList<>(); for (String text: q.getLevelNames()) { level.add(new XmlLevel(text)); } } break; case CADDISFLY: caddisflyResourceUuid = q.getCaddisflyResourceUuid(); break; case OPTION: if (q.getQuestionOptionMap() != null) { options = new XmlOptions(q); } break; default: break; } if (Boolean.TRUE.equals(q.getDependentFlag())) { dependency = new XmlDependency(q.getDependentQuestionId(), q.getDependentQuestionAnswer()); } if (q.getTranslationMap() != null) { altText = new ArrayList<>(); for (Translation t: q.getTranslationMap().values()) { altText.add(new XmlAltText(t)); } } }