@AnnotatedFor(value="nullness") public enum I18nConversionCategory extends Enum<I18nConversionCategory>
I18nFormat annotation to indicate the valid
types that may be passed as a format parameter. For example:
@I18nFormat({GENERAL, NUMBER}) String f = "{0}{1, number}";
MessageFormat.format(f, "Example", 0) // valid
The annotation indicates that the format string requires any object as the first parameter
(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 | Method and Description |
|---|---|
static I18nConversionCategory |
intersect(I18nConversionCategory a,
I18nConversionCategory b)
Returns the intersection of the two given I18nConversionCategories.
|
boolean |
isAssignableFrom(Class<?> argType)
Returns true if
argType can be an argument used by this format specifier. |
static boolean |
isSubsetOf(I18nConversionCategory a,
I18nConversionCategory b)
Return true if a is a subset of b.
|
static I18nConversionCategory |
stringToI18nConversionCategory(String string)
Creates a conversion cagetogry from a string name.
|
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 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 boolean isAssignableFrom(Class<?> argType)
argType can be an argument used by this format specifier.argType - an argument typeargType can be an argument used by this format specifierpublic String toString()
I18nConversionCategory.toString in class Enum<I18nConversionCategory>