Class TranslationBundle

java.lang.Object
com.inductiveautomation.ignition.common.i18n.translation.TranslationBundle

public final class TranslationBundle extends Object
This class contains translated keys for a specific locale.

Each entry's value is a nullable string: a non-null value is a translation (which may be the empty string), while a null value marks a key that is defined for this locale but has no translation. A key that is absent from the map is not defined for this locale at all; use contains(HashedKey) to distinguish absent from defined-but-untranslated.

  • Constructor Details

    • TranslationBundle

      public TranslationBundle(Locale locale)
    • TranslationBundle

      public TranslationBundle(TranslationBundle copy)
  • Method Details

    • getLocale

      public Locale getLocale()
    • getValues

      public Map<HashedKey, @Nullable String> getValues()
    • getOrNull

      public @Nullable String getOrNull(HashedKey key)
      Returns the translation, or null if the key isn't present or has no translation.
    • contains

      public boolean contains(HashedKey key)
      Whether the key is present for this locale, whether or not it carries a translation.
    • add

      public void add(HashedKey key, @Nullable String value)
    • remove

      public boolean remove(HashedKey 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 o)
      Overrides:
      equals in class Object