Enum LocaleMatcher
- java.lang.Object
-
- java.lang.Enum<LocaleMatcher>
-
- org.pepstock.charba.client.intl.enums.LocaleMatcher
-
- All Implemented Interfaces:
Serializable
,Comparable<LocaleMatcher>
,Key
public enum LocaleMatcher extends Enum<LocaleMatcher> implements Key
The list of locales specified by the locales argument, after Unicode extensions have been removed from them, is interpreted as a prioritized request from the application.
The runtime compares it against the locales it has available and picks the best one available.
Two matching algorithms exist, "lookup" and "best fit".- Author:
- Andrea "Stock" Stocchero
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BEST_FIT
Lets the runtime provide a locale that's at least, but possibly more, suited for the request than the result of the Lookup algorithm.LOOKUP
Used to select the single language tag that best matches the language priority list for a given request.
When performing lookup, each language range in the language priority list is considered in turn, according to priority.
By contrast with filtering, each language range represents the most specific tag that is an acceptable match.
See BCP 47 for more details.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
value()
Returns the name value of propertystatic LocaleMatcher
valueOf(String name)
Returns the enum constant of this type with the specified name.static LocaleMatcher[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOOKUP
public static final LocaleMatcher LOOKUP
Used to select the single language tag that best matches the language priority list for a given request.
When performing lookup, each language range in the language priority list is considered in turn, according to priority.
By contrast with filtering, each language range represents the most specific tag that is an acceptable match.
See BCP 47 for more details.
-
BEST_FIT
public static final LocaleMatcher BEST_FIT
Lets the runtime provide a locale that's at least, but possibly more, suited for the request than the result of the Lookup algorithm.
-
-
Method Detail
-
values
public static LocaleMatcher[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LocaleMatcher c : LocaleMatcher.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LocaleMatcher valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-