private void traverse(final Module module, final Integer depth, final StringBuilder sb) { final String indent = Strings.repeat(INDENTATION, depth); sb.append(indent) .append("<m name=\"") .append(module.getTitle()) .append("\" ") .append(formatMandatory(module)) .append(" pordnr=\"") .append(module.getPordnr()) .append("\" ") .append(formatCreditPoints(module)) .append(" />\n"); }
private String formatMandatory(final Module mod) { if (!mod.getMandatory()) { return ""; } return "pflicht=\"j\""; }
private String formatCreditPoints(final Module module) { if (module.getCreditPoints() < 0) { return ""; } return "cp=\"" + module.getCreditPoints() + "\""; }