Package com.ibm.icu.util
Enum LocaleMatcher.Direction
- All Implemented Interfaces:
Serializable
,Comparable<LocaleMatcher.Direction>
,java.lang.constant.Constable
- Enclosing class:
LocaleMatcher
Builder option for whether to include or ignore one-way (fallback) match data.
The LocaleMatcher uses CLDR languageMatch data which includes fallback (oneway=true) entries.
Sometimes it is desirable to ignore those.
For example, consider a web application with the UI in a given language, with a link to another, related web app. The link should include the UI language, and the target server may also use the client’s Accept-Language header data. The target server has its own list of supported languages. One may want to favor UI language consistency, that is, if there is a decent match for the original UI language, we want to use it, but not if it is merely a fallback.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLocale matching limited to two-way matches including e.g.Locale matching includes one-way matches such as Breton→French. -
Method Summary
Modifier and TypeMethodDescriptionstatic LocaleMatcher.Direction
Returns the enum constant of this type with the specified name.static LocaleMatcher.Direction[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
WITH_ONE_WAY
Locale matching includes one-way matches such as Breton→French. (default) -
ONLY_TWO_WAY
Locale matching limited to two-way matches including e.g. Danish↔Norwegian but ignoring one-way matches.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-