public String createFromName() { if (getCourse() != null && getCourse().getExecutionPeriod() != null && getCourse().getExecutionPeriod().getQualifiedName() != null) { String degreeName = getCourse().getDegreePresentationString(); String courseName = getCourse().getNome(); String period = getCourse().getExecutionPeriod().getQualifiedName().replace('/', '-'); return String.format( "%s (%s: %s, %s)", Unit.getInstitutionAcronym(), degreeName, courseName, period); } else { return getFromName(); } }