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