public class TranslationBundle
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and 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 and Description |
---|
TranslationBundle()
For serialization
|
TranslationBundle(java.util.Locale locale) |
TranslationBundle(TranslationBundle copy) |
Modifier and Type | Method and 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() |
public static final java.lang.String TRAN_PLACEHOLDER
public TranslationBundle()
public TranslationBundle(java.util.Locale locale)
public TranslationBundle(TranslationBundle copy)
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public java.util.Map<TermKey,java.lang.String> getValues()
public void setValues(java.util.Map<TermKey,java.lang.String> values)
protected java.util.Set<java.util.Map.Entry<TermKey,java.lang.String>> entries()
public java.lang.String get(TermKey key)
id
- public java.lang.String getOrNull(TermKey key)
public boolean contains(TermKey key)
public void add(TermKey key, java.lang.String value)
public boolean remove(TermKey key)
key
- public void merge(TranslationBundle bundle)
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object