Constructor and Description |
---|
LocalizedString(String key,
String[] fallbackKeys,
String defaultValue,
Translator translator,
Locale locale,
Object... args) |
LocalizedString(String key,
String defaultValue,
Translator translator,
Locale locale,
Object... args) |
LocalizedString(String key,
Translator translator,
Object... args) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
get()
Returns translated message.
|
String |
getOptional()
Returns translated message or key value if translation does not exists.
|
static String |
getOrEmpty(LocalizedString string)
Returns value of localized string or empty string "" if specified localized string is null.
|
int |
hashCode() |
static LocalizedString |
of(String value)
Creates LocalizedString with static value.
|
String |
toString() |
public LocalizedString(String key, Translator translator, Object... args)
public LocalizedString(String key, String defaultValue, Translator translator, Locale locale, Object... args)
public static LocalizedString of(String value)
value
- valueLocalizedString
which always returns given valuepublic static String getOrEmpty(LocalizedString string)
string
- localized stringpublic String get() throws NoTranslationException
NoTranslationException
- no translation found and no default value specifiedpublic String getOptional()
get()
Copyright © 2019 Suncode. All rights reserved.