public final class LocalizedStringEntry extends Base
Modifier and Type | Method and Description |
---|---|
Locale |
getLocale() |
String |
getValue() |
static LocalizedStringEntry |
of(Locale locale,
String value) |
static LocalizedStringEntry |
of(String languageTag,
String value)
Creates an entry for language tag and a value.
|
public static LocalizedStringEntry of(Locale locale, String value)
public static LocalizedStringEntry of(String languageTag, String value)
The language tag can be just a language code
final LocalizedStringEntry entry = LocalizedStringEntry.of("de", "foo"); assertThat(entry.getLocale()).isEqualTo(Locale.GERMAN); assertThat(entry.getValue()).isEqualTo("foo");
See the test code.
or language and a country
final LocalizedStringEntry entry = LocalizedStringEntry.of("de-DE", "foo"); assertThat(entry.getLocale()).isEqualTo(Locale.GERMANY); assertThat(entry.getValue()).isEqualTo("foo");
See the test code.
languageTag
- language tag as in Locale.forLanguageTag(String)
value
- value of this entrypublic Locale getLocale()
public String getValue()