Enum LanguageRangeEquivalents
- All Implemented Interfaces:
Serializable, Comparable<LanguageRangeEquivalents>, Constable
Controls where Lokalized takes IANA language-range equivalences from when it parses language ranges, such as the
he/iw pair that makes a request for either language also consider the other.
The source decides which equivalent ranges LocaleMatcher.parseLanguageRanges(String) and
LocaleMatcher.bestMatchForAcceptLanguage(String) add, and which ranges locale matching treats as equivalent,
so it can change which loaded locale a request selects. Configure it with
Strings.Builder.languageRangeEquivalents(LanguageRangeEquivalents).
- Since:
- 3.1.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUse the IANA Language Subtag Registry snapshot bundled in Lokalized:File-Date: 2026-09-17, SHA-256755fad43283be7b41ebe3c89ad054b6eaf928f404f9c0edb74799e0eab74beb1.Use the running JDK's own table, throughLocale.LanguageRange.parse(String). -
Method Summary
Modifier and TypeMethodDescriptionstatic LanguageRangeEquivalentsReturns the enum constant of this type with the specified name.static LanguageRangeEquivalents[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
IANA_REGISTRY
Use the IANA Language Subtag Registry snapshot bundled in Lokalized:File-Date: 2026-09-17, SHA-256755fad43283be7b41ebe3c89ad054b6eaf928f404f9c0edb74799e0eab74beb1.The equivalents it supplies are identical on every JDK. This is the default.
-
JDK
Use the running JDK's own table, throughLocale.LanguageRange.parse(String).That table is bundled with the JDK and differs between JDK releases, including update releases, so the same request can select a different locale on a different JVM. This reproduces the behavior of Lokalized 3.0.0, which always used the running JDK's table.
-
-
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
-