java.lang.Object
com.inductiveautomation.ignition.common.i18n.translation.TranslationBundle
All Implemented Interfaces:
Serializable

public class TranslationBundle extends Object implements Serializable
This class contains translated terms for a specific locale.
See Also:
  • Field Details

    • TRAN_PLACEHOLDER

      public static final String TRAN_PLACEHOLDER
      This sentinal value is used to build a map that contains all of the keys, it indicates that the specific key doesn't have a translation.
      See Also:
  • Constructor Details

    • TranslationBundle

      public TranslationBundle()
      For serialization
    • TranslationBundle

      public TranslationBundle(Locale locale)
    • TranslationBundle

      public TranslationBundle(TranslationBundle copy)
  • Method Details

    • getLocale

      public Locale getLocale()
    • setLocale

      public void setLocale(Locale locale)
    • getValues

      public Map<TermKey,String> getValues()
    • setValues

      public void setValues(Map<TermKey,String> values)
    • entries

      protected Set<Map.Entry<TermKey,String>> entries()
    • get

      public String get(TermKey key)
      Returns the term, if present, or null if not.
    • getOrNull

      public String getOrNull(TermKey key)
      Returns the value, or null if the key isn't present, OR the "no translation" placeholder is present.
    • contains

      public boolean contains(TermKey key)
    • add

      public void add(TermKey key, String value)
    • remove

      public boolean remove(TermKey key)
      Removes the key and its translation, returning whether or not it was present.
    • merge

      public void merge(TranslationBundle bundle)
    • size

      public int size()
    • toString

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

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

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