| 1 | |
package org.kuali.student.lum.statement.config.context.util; |
| 2 | |
|
| 3 | |
import org.kuali.student.lum.lu.dto.CluInfo; |
| 4 | |
|
| 5 | 0 | public class NLHelper { |
| 6 | |
|
| 7 | |
public static String getProperGrammar(Number number, String singularText, String pluralText) { |
| 8 | 0 | return (number.intValue() == 1 ? singularText : pluralText); |
| 9 | |
} |
| 10 | |
|
| 11 | |
public static String getProperGrammar(Number number, String singularText) { |
| 12 | 0 | return (number.intValue() == 1 ? singularText : singularText + "s"); |
| 13 | |
} |
| 14 | |
|
| 15 | |
public static String getProperGrammar(String number, String singularText, String pluralText) { |
| 16 | 0 | return getProperGrammar(Integer.valueOf(number), singularText, pluralText); |
| 17 | |
} |
| 18 | |
|
| 19 | |
public static String getProperGrammar(String number, String singularText) { |
| 20 | 0 | return getProperGrammar(Integer.valueOf(number), singularText); |
| 21 | |
} |
| 22 | |
|
| 23 | |
public static String getCluOrCluSetAsShortNames(CluInfo clu, NLCluSet cluSet) { |
| 24 | 0 | if(clu != null) { |
| 25 | 0 | return clu.getOfficialIdentifier().getShortName(); |
| 26 | |
} |
| 27 | 0 | return cluSet.getCluSetAsShortName(); |
| 28 | |
} |
| 29 | |
|
| 30 | |
public static String getCluOrCluSetAsLongNames(CluInfo clu, NLCluSet cluSet) { |
| 31 | 0 | if(clu != null) { |
| 32 | 0 | return clu.getOfficialIdentifier().getLongName(); |
| 33 | |
} |
| 34 | 0 | return cluSet.getCluSetAsLongName(); |
| 35 | |
} |
| 36 | |
} |