Package pl.edu.icm.unity.types
Class I18nString
- java.lang.Object
-
- pl.edu.icm.unity.types.I18nString
-
public class I18nString extends Object
String in several languages. Besides localized versions can store also a default value which is returned when there is no version for the requested locale and default locale.- Author:
- K. Benedyczak
-
-
Constructor Summary
Constructors Constructor Description I18nString()
I18nString(String defaultValue)
I18nString(String locale, String value)
I18nString(String key, MessageSource msg, Object... args)
LoadsI18nString
from all message bundles which are installed in the system.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllValues(Map<String,String> values)
void
addValue(String locale, String value)
I18nString
clone()
boolean
equals(Object obj)
static I18nString
fromJson(com.fasterxml.jackson.databind.JsonNode json)
String
getDefaultLocaleValue(MessageSource msg)
String
getDefaultValue()
Map<String,String>
getMap()
String
getValue(String locale)
String
getValue(String locale, String defaultLocale)
String
getValue(MessageSource msg)
String
getValueRaw(String locale)
int
hashCode()
boolean
hasNonDefaultValue()
boolean
isEmpty()
void
replace(String oldV, String newV)
void
setDefaultValue(String defaultValue)
com.fasterxml.jackson.databind.JsonNode
toJson()
void
toProperties(Properties properties, String prefix, MessageSource msg)
String
toString()
-
-
-
Constructor Detail
-
I18nString
public I18nString()
-
I18nString
public I18nString(String defaultValue)
-
I18nString
public I18nString(String key, MessageSource msg, Object... args)
LoadsI18nString
from all message bundles which are installed in the system. The returned object has no default value set.
-
-
Method Detail
-
fromJson
public static I18nString fromJson(com.fasterxml.jackson.databind.JsonNode json)
-
toJson
public com.fasterxml.jackson.databind.JsonNode toJson()
-
getValue
public String getValue(MessageSource msg)
-
getDefaultLocaleValue
public String getDefaultLocaleValue(MessageSource msg)
-
getDefaultValue
public String getDefaultValue()
-
setDefaultValue
public void setDefaultValue(String defaultValue)
-
isEmpty
public boolean isEmpty()
-
hasNonDefaultValue
public boolean hasNonDefaultValue()
-
clone
public I18nString clone()
-
toProperties
public void toProperties(Properties properties, String prefix, MessageSource msg)
-
-