List of usage examples for java.lang String toUpperCase
public String toUpperCase()
From source file:ch.aonyx.broker.ib.api.data.historical.TimeSpanUnit.java
public static final TimeSpanUnit fromInitial(final String initial) { if (StringUtils.isBlank(initial)) { return EMPTY; }/*from w ww . j a va 2s. co m*/ final String initialUpperCase = initial.toUpperCase(); if (MAP.containsKey(initialUpperCase)) { return MAP.get(initialUpperCase); } return UNKNOWN; }
From source file:ch.aonyx.broker.ib.api.order.HedgeType.java
public static final HedgeType fromInitial(final String initial) { if (StringUtils.isBlank(initial)) { return EMPTY; }/*from w w w . ja v a 2 s . c o m*/ final String initialUpperCase = initial.toUpperCase(); if (MAP.containsKey(initialUpperCase)) { return MAP.get(initialUpperCase); } return UNKNOWN; }
From source file:ch.aonyx.broker.ib.api.order.OpenCloseInstitutional.java
public static final OpenCloseInstitutional fromInitial(final String initial) { if (StringUtils.isBlank(initial)) { return EMPTY; }//from ww w .ja va 2 s .c om final String initialUpperCase = initial.toUpperCase(); if (MAP.containsKey(initialUpperCase)) { return MAP.get(initialUpperCase); } return UNKNOWN; }
From source file:ch.aonyx.broker.ib.api.order.Rule80A.java
public static final Rule80A fromInitial(final String initial) { if (StringUtils.isBlank(initial)) { return EMPTY; }/*from w w w. jav a 2 s. c o m*/ final String initialUpperCase = initial.toUpperCase(); if (MAP.containsKey(initialUpperCase)) { return MAP.get(initialUpperCase); } return UNKNOWN; }
From source file:com.cognifide.cq.cqsm.api.executors.Mode.java
public static Mode fromString(String modeName, Mode defaultMode) { return (StringUtils.isEmpty(modeName)) ? defaultMode : Mode.valueOf(modeName.toUpperCase()); }
From source file:com.bazaarvoice.lassie.screenboard.widgets.Aggregator.java
/** * Parse an aggregator name into the corresponding {@link Aggregator} value. * * @param name The aggregator's name.//from w ww .j ava 2s . co m * @return The aggregator matching the name. */ @JsonCreator public static Aggregator fromName(String name) { checkNotNull(name); if (name.equals("avg")) { return AVERAGE; } return Aggregator.valueOf(name.toUpperCase()); }
From source file:com.carlomicieli.jtrains.validation.ISOValidationUtils.java
/** * Returns {@code true} if the value is a valid 2-letter country code as defined in ISO 3166. * @param country the country code//from w w w. j a v a2s.c om * @return {@code true} if the value is a valid country; {@code false} otherwise */ public static boolean countryIsValid(String country) { if (StringUtils.isBlank(country)) { return true; } return Arrays.binarySearch(Locale.getISOCountries(), country.toUpperCase()) >= 0; }
From source file:it.unibas.spicy.persistence.object.ClassUtility.java
public static String convertFirstCapitalLetter(String stringToConvert) { String firstChar = stringToConvert.substring(0, 1); String firstCharCapital = firstChar.toUpperCase(); String convertedFieldName = firstCharCapital + stringToConvert.substring(1, stringToConvert.length()); return convertedFieldName; }
From source file:Main.java
public static int romanToInteger(java.lang.String romanNumber) { int decimal = 0; int lastNumber = 0; String romanNumeral = romanNumber.toUpperCase(); /* operation to be performed on upper cases even if user enters roman values in lower case chars */ for (int x = romanNumeral.length() - 1; x >= 0; x--) { char convertToDecimal = romanNumeral.charAt(x); switch (convertToDecimal) { case 'M': decimal = processDecimal(1000, lastNumber, decimal); lastNumber = 1000;//from w w w .j a v a 2 s. com break; case 'D': decimal = processDecimal(500, lastNumber, decimal); lastNumber = 500; break; case 'C': decimal = processDecimal(100, lastNumber, decimal); lastNumber = 100; break; case 'L': decimal = processDecimal(50, lastNumber, decimal); lastNumber = 50; break; case 'X': decimal = processDecimal(10, lastNumber, decimal); lastNumber = 10; break; case 'V': decimal = processDecimal(5, lastNumber, decimal); lastNumber = 5; break; case 'I': decimal = processDecimal(1, lastNumber, decimal); lastNumber = 1; break; } } return decimal; }
From source file:Main.java
public static String titleCase(String s) { StringBuilder rv = new StringBuilder(s.length()); StringTokenizer strtok = new StringTokenizer(s); while (strtok.hasMoreTokens()) { String word = strtok.nextToken(); String firstLetter = word.substring(0, 1); String restOfWord = word.substring(1); if (rv.length() > 0) rv.append(" "); rv.append(firstLetter.toUpperCase()); rv.append(restOfWord.toLowerCase()); }/*from www . jav a 2 s . co m*/ return rv.toString(); }