public enum I18nConversionCategory extends Enum<I18nConversionCategory>
I18nFormat
annotation to indicate the valid
types that may be passed as a format parameter. For example:
The annotation indicates that the format string requires any object as the first parameter (@I18nFormat({I18nConversionCategory.GENERAL, I18nConversionCategory.NUMBER}) String f = "{0}{1, number}"; MessageFormat.format(f, "Example", 0) // valid
GENERAL
) and a number as the second parameter (NUMBER
).Enum Constant and Description |
---|
DATE
Use if the parameter can be of date, time, or number types
|
GENERAL
Use if the parameter can be of any type.
|
NUMBER
Use if the parameter can be of number or choice types.
|
UNUSED
Use if a parameter is not used by the formatter.
|
Modifier and Type | Field and Description |
---|---|
String[] |
strings |
Class<? extends Object>[] |
types |
Modifier and Type | Method and Description |
---|---|
static I18nConversionCategory |
intersect(I18nConversionCategory a,
I18nConversionCategory b)
Returns the intersection of the two given I18nConversionCategories
|
static boolean |
isSubsetOf(I18nConversionCategory a,
I18nConversionCategory b) |
static I18nConversionCategory |
stringToI18nConversionCategory(String string)
I18nConversionCategory.stringToI18nConversionCategory("number") == I18nConversionCategory.NUMBER;
|
String |
toString()
Returns a pretty printed
I18nConversionCategory . |
static I18nConversionCategory |
union(I18nConversionCategory a,
I18nConversionCategory b)
Returns the union of the two given I18nConversionCategories
|
static I18nConversionCategory |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static I18nConversionCategory[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final I18nConversionCategory UNUSED
MessageFormat.format("{1}", a, b);Only the second argument ("b") is used. The first argument ("a") is ignored
public static final I18nConversionCategory GENERAL
public static final I18nConversionCategory DATE
public static final I18nConversionCategory NUMBER
format("{0, choice, 0#zero|1#one|1<{0, number} is more than 1}", 2)
This will print "2 is more than 1".public final String[] strings
public static I18nConversionCategory[] values()
for (I18nConversionCategory c : I18nConversionCategory.values()) System.out.println(c);
public static I18nConversionCategory valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static I18nConversionCategory stringToI18nConversionCategory(String string)
I18nConversionCategory.stringToI18nConversionCategory("number") == I18nConversionCategory.NUMBER;
public static boolean isSubsetOf(I18nConversionCategory a, I18nConversionCategory b)
public static I18nConversionCategory intersect(I18nConversionCategory a, I18nConversionCategory b)
I18nConversionCategory.intersect(DATE, NUMBER) == NUMBER;
public static I18nConversionCategory union(I18nConversionCategory a, I18nConversionCategory b)
I18nConversionCategory.intersect(DATE, NUMBER) == DATE;
public String toString()
I18nConversionCategory
.toString
in class Enum<I18nConversionCategory>