/** * Constructs an object from a non-numeric value. * The field type is set to an enum value corresponding to the string given, and explicitValue * is set to -1. * @param typeStr String representation of the non-numeric value. * @throws IllegalArgumentException if typeStr (after converting to upper * case) does not match with any of the enum types. */ public SoyMsgPluralCaseSpec(String typeStr) { type = Type.valueOf(typeStr.toUpperCase(Locale.ENGLISH)); explicitValue = -1; }
/** * Gets the opening (left) string for a plural case statement. * * @param pluralCaseSpec The plural case spec object. * @return the ICU syntax string for the plural case opening string. */ private static String getPluralCaseOpenString(SoyMsgPluralCaseSpec pluralCaseSpec) { String icuCaseName = (pluralCaseSpec.getType() == SoyMsgPluralCaseSpec.Type.EXPLICIT) ? "=" + pluralCaseSpec.getExplicitValue() : pluralCaseSpec.getType().name().toLowerCase(); return icuCaseName + "{"; }
/** * Gets the opening (left) string for a plural case statement. * * @param pluralCaseSpec The plural case spec object. * @return the ICU syntax string for the plural case opening string. */ private static String getPluralCaseOpenString(SoyMsgPluralCaseSpec pluralCaseSpec) { String icuCaseName = (pluralCaseSpec.getType() == SoyMsgPluralCaseSpec.Type.EXPLICIT) ? "=" + pluralCaseSpec.getExplicitValue() : pluralCaseSpec.getType().name().toLowerCase(); return icuCaseName + "{"; }
/** * Constructs an object from a non-numeric value. * * @param typeStr String representation of the non-numeric value. * @throws IllegalArgumentException if typeStr (after converting to upper case) does not match * with any of the enum types. */ public SoyMsgPluralCaseSpec(String typeStr) { this(Type.valueOf(Ascii.toUpperCase(typeStr))); }
/** * Constructs an object from a non-numeric value. * * @param typeStr String representation of the non-numeric value. * @throws IllegalArgumentException if typeStr (after converting to upper case) does not match * with any of the enum types. */ public SoyMsgPluralCaseSpec(String typeStr) { this(Type.valueOf(Ascii.toUpperCase(typeStr))); }