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 Details

    • I18nString

      public I18nString()
    • I18nString

      public I18nString(String defaultValue)
    • I18nString

      public I18nString(String locale, String value)
    • I18nString

      public I18nString(String key, MessageSource msg, Object... args)
      Loads I18nString from all message bundles which are installed in the system. The returned object has no default value set.
  • Method Details

    • 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)
    • getValue

      public String getValue(String locale, String defaultLocale)
    • getValue

      public String getValue(String locale)
    • getValueRaw

      public String getValueRaw(String locale)
    • addValue

      public void addValue(String locale, String value)
    • addAllValues

      public void addAllValues(Map<String,String> values)
    • getMap

      public Map<String,String> getMap()
    • getDefaultLocaleValue

      public String getDefaultLocaleValue(MessageSource msg)
    • getDefaultValue

      public String getDefaultValue()
    • setDefaultValue

      public void setDefaultValue(String defaultValue)
    • isEmpty

      public boolean isEmpty()
    • hasNonDefaultValue

      public boolean hasNonDefaultValue()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public I18nString clone()
      Overrides:
      clone in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toProperties

      public void toProperties(Properties properties, String prefix, MessageSource msg)
    • replace

      public void replace(String oldV, String newV)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object