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.SerializableThis class contains translated terms for a specific locale.- See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTRAN_PLACEHOLDERThis 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 voidadd(TermKey key, java.lang.String value)booleancontains(TermKey key)protected java.util.Set<java.util.Map.Entry<TermKey,java.lang.String>>entries()booleanequals(java.lang.Object obj)java.lang.Stringget(TermKey key)Returns the term, if present, or null if not.java.util.LocalegetLocale()java.lang.StringgetOrNull(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()inthashCode()voidmerge(TranslationBundle bundle)booleanremove(TermKey key)Removes the key and its translation, returning whether or not it was present.voidsetLocale(java.util.Locale locale)voidsetValues(java.util.Map<TermKey,java.lang.String> values)intsize()java.lang.StringtoString() 
 - 
 
- 
- 
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:
 toStringin classjava.lang.Object
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
equals
public boolean equals(java.lang.Object obj)
- Overrides:
 equalsin classjava.lang.Object
 
 - 
 
 -