Package nl.vpro.i18n
Class LocalizedString
- java.lang.Object
-
- nl.vpro.i18n.LocalizedString
-
- All Implemented Interfaces:
Serializable
,CharSequence
- Direct Known Subclasses:
LocalizedString.Impl
public class LocalizedString extends Object implements CharSequence, Serializable
Basically wraps a string together with theLocale
describing in what language it is.- Since:
- 3.2
- Author:
- Michiel Meeuwissen
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LocalizedString.Builder
static class
LocalizedString.Impl
static class
LocalizedString.XmlLangAdapter
-
Constructor Summary
Constructors Modifier Constructor Description LocalizedString()
protected
LocalizedString(Locale locale, @NonNull String value, String charsetName)
protected
LocalizedString(LocalizedString copy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Locale
adapt(String v)
static LocalizedString.Builder
builder()
static LocalizedString.Builder
builderOf(String value)
char
charAt(int index)
boolean
equals(Object o)
static String
get(Locale locale, Iterable<? extends LocalizedString> strings)
String
getCharsetName()
Locale
getLocale()
@NonNull String
getValue()
int
hashCode()
static LocalizedString.Impl
impl(String value, Locale locale)
int
length()
static @PolyNull LocalizedString
of(@PolyNull String value, Locale locale)
void
setCharsetName(String charsetName)
void
setLocale(Locale locale)
void
setValue(@NonNull String value)
LocalizedString
subSequence(int start, int end)
LocalizedString.Builder
toBuilder()
@NonNull String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
LocalizedString
public LocalizedString()
-
LocalizedString
protected LocalizedString(Locale locale, @NonNull String value, String charsetName)
-
LocalizedString
protected LocalizedString(LocalizedString copy)
-
-
Method Detail
-
of
public static @PolyNull LocalizedString of(@PolyNull String value, Locale locale)
-
builderOf
public static LocalizedString.Builder builderOf(String value)
-
get
public static String get(Locale locale, Iterable<? extends LocalizedString> strings)
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
subSequence
public LocalizedString subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
toString
public @NonNull String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
impl
public static LocalizedString.Impl impl(String value, Locale locale)
-
builder
public static LocalizedString.Builder builder()
-
toBuilder
public LocalizedString.Builder toBuilder()
-
getLocale
public Locale getLocale()
-
setLocale
public void setLocale(Locale locale)
-
getValue
public @NonNull String getValue()
-
setValue
public void setValue(@NonNull String value)
-
getCharsetName
public String getCharsetName()
-
setCharsetName
public void setCharsetName(String charsetName)
-
-