Top Description Fields Constructors Methods
org.checkerframework.checker.i18nformatter.qual

public final Enum I18nConversionCategory

extends Enum<I18nConversionCategory>
Class Inheritance
Annotations
@AnnotatedFor:nullness
Imports
java.util.Arrays, .Date, .HashSet, .Set, .StringJoiner, org.checkerframework.checker.nullness.qual.Nullable, org.checkerframework.framework.qual.AnnotatedFor

Elements of this enumeration are used in a 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 (I18nConversionCategory#GENERAL) and a number as the second parameter (I18nConversionCategory#NUMBER).

Field Summary

Modifier and TypeField and Description
private static final I18nConversionCategory[]
conversionCategoriesForIntersect

Conversion categories that need to be considered by intersect.

public static final I18nConversionCategory
DATE

Use if the parameter can be of date, time, or number types.

public static final I18nConversionCategory
GENERAL

Use if the parameter can be of any type.

private static final I18nConversionCategory[]
public static final I18nConversionCategory
NUMBER

Use if the parameter can be of number or choice types.

public final @Nullable []
public final @Nullable Class<?>[]
public static final I18nConversionCategory
UNUSED

Use if a parameter is not used by the formatter.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static <E> Set<E>
arrayToSet(E[] a)

public static I18nConversionCategory
intersect(I18nConversionCategory a, I18nConversionCategory b)

Returns the intersection of the two given I18nConversionCategories.

public boolean

Returns:

true if argType can be an argument used by this format specifier
isAssignableFrom
(Class<?>
an argument type
argType
)

Returns true if argType can be an argument used by this format specifier.

public static boolean

Returns:

true if a is a subset of b
isSubsetOf
(I18nConversionCategory a, I18nConversionCategory b)

Return true if a is a subset of b.

public static I18nConversionCategory

Returns:

the I18nConversionCategory associated with the given string
stringToI18nConversionCategory
(String string)

Creates a conversion cagetogry from a string name.

public String
toString()

Overrides java.lang.Enum.toString.

Returns a pretty printed I18nConversionCategory.
public static I18nConversionCategory
union(I18nConversionCategory a, I18nConversionCategory b)

Returns the union of the two given I18nConversionCategories.

public static I18nConversionCategory
public static I18nConversionCategory[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

conversionCategoriesForIntersectback to summary
private static final I18nConversionCategory[] conversionCategoriesForIntersect

Conversion categories that need to be considered by intersect.

DATEback to summary
public static final I18nConversionCategory DATE

Use if the parameter can be of date, time, or number types.

GENERALback to summary
public static final I18nConversionCategory GENERAL

Use if the parameter can be of any type.

namedCategoriesback to summary
private static final I18nConversionCategory[] namedCategories

Used by stringToI18nConversionCategory.

NUMBERback to summary
public static final I18nConversionCategory NUMBER

Use if the parameter can be of number or choice types. An example of choice:

format("{0, choice, 0#zero|1#one|1<{0, number} is more than 1}", 2)
This will print "2 is more than 1".
stringsback to summary
public final @Nullable [] strings
Annotations
@SuppressWarnings:ImmutableEnumChecker
typesback to summary
public final @Nullable Class<?>[] types
Annotations
@SuppressWarnings:ImmutableEnumChecker
UNUSEDback to summary
public static final I18nConversionCategory UNUSED

Use if a parameter is not used by the formatter. For example, in

MessageFormat.format("{1}", a, b);
only the second argument ("b") is used. The first argument ("a") is ignored.

Constructor Detail

I18nConversionCategoryback to summary
private I18nConversionCategory(@Nullable Class<?>[] types, @Nullable [] strings)

Method Detail

arrayToSetback to summary
private static <E> Set<E> arrayToSet(E[] a)
intersectback to summary
public static I18nConversionCategory intersect(I18nConversionCategory a, I18nConversionCategory b)

Returns the intersection of the two given I18nConversionCategories.

I18nConversionCategory.intersect(DATE, NUMBER) == NUMBER;
isAssignableFromback to summary
public boolean isAssignableFrom(Class<?> argType)

Returns true if argType can be an argument used by this format specifier.

Parameters
argType:Class<?>

an argument type

Returns:boolean

true if argType can be an argument used by this format specifier

isSubsetOfback to summary
public static boolean isSubsetOf(I18nConversionCategory a, I18nConversionCategory b)

Return true if a is a subset of b.

Returns:boolean

true if a is a subset of b

stringToI18nConversionCategoryback to summary
public static I18nConversionCategory stringToI18nConversionCategory(String string)

Creates a conversion cagetogry from a string name.

I18nConversionCategory.stringToI18nConversionCategory("number") == I18nConversionCategory.NUMBER;
Returns:I18nConversionCategory

the I18nConversionCategory associated with the given string

Annotations
@SuppressWarnings:nullness:iterating.over.nullable
toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Returns a pretty printed I18nConversionCategory.

Returns:String

Doc from java.lang.Enum.toString.

the name of this enum constant

Annotations
@Override
unionback to summary
public static I18nConversionCategory union(I18nConversionCategory a, I18nConversionCategory b)

Returns the union of the two given I18nConversionCategories.

I18nConversionCategory.intersect(DATE, NUMBER) == DATE;
valueOfback to summary
public static I18nConversionCategory valueOf(String name)
valuesback to summary
public static I18nConversionCategory[] values()