Class TranslationBundle
- java.lang.Object
-
- com.inductiveautomation.ignition.common.i18n.translation.TranslationBundle
-
- All Implemented Interfaces:
java.io.Serializable
public class TranslationBundle extends java.lang.Object implements java.io.Serializable
This class contains translated terms for a specific locale.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.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.
-
Constructor Summary
Constructors Constructor Description TranslationBundle()
For serializationTranslationBundle(TranslationBundle copy)
TranslationBundle(java.util.Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(TermKey key, java.lang.String value)
boolean
contains(TermKey key)
protected java.util.Set<java.util.Map.Entry<TermKey,java.lang.String>>
entries()
boolean
equals(java.lang.Object obj)
java.lang.String
get(TermKey key)
Returns the term, if present, or null if not.java.util.Locale
getLocale()
java.lang.String
getOrNull(TermKey key)
Returns the value, or null if the key isn't present, OR the "no translation" placeholder is present.java.util.Map<TermKey,java.lang.String>
getValues()
int
hashCode()
void
merge(TranslationBundle bundle)
boolean
remove(TermKey key)
Removes the key and its translation, returning whether or not it was present.void
setLocale(java.util.Locale locale)
void
setValues(java.util.Map<TermKey,java.lang.String> values)
int
size()
java.lang.String
toString()
-
-
-
Field Detail
-
TRAN_PLACEHOLDER
public static final java.lang.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:
- Constant Field Values
-
-
Constructor Detail
-
TranslationBundle
public TranslationBundle()
For serialization
-
TranslationBundle
public TranslationBundle(java.util.Locale locale)
-
TranslationBundle
public TranslationBundle(TranslationBundle copy)
-
-
Method Detail
-
getLocale
public java.util.Locale getLocale()
-
setLocale
public void setLocale(java.util.Locale locale)
-
getValues
public java.util.Map<TermKey,java.lang.String> getValues()
-
setValues
public void setValues(java.util.Map<TermKey,java.lang.String> values)
-
entries
protected java.util.Set<java.util.Map.Entry<TermKey,java.lang.String>> entries()
-
get
public java.lang.String get(TermKey key)
Returns the term, if present, or null if not.
-
getOrNull
public java.lang.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, java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-