Package com.transifex.common
Class LocaleData.TranslationMap
java.lang.Object
com.transifex.common.LocaleData.TranslationMap
- Enclosing class:
- LocaleData
A class that holds translations for multiple locales. It maps locale codes to
LocaleData.LocaleStrings objects.-
Constructor Summary
ConstructorsConstructorDescriptionTranslationMap(int initialCapacity) Constructs an emptyTranslationMapwith the specified initial capacity.TranslationMap(LocaleData.TranslationMap translationMap) Creates a new TranslationMap object by making a copy of the provided one.Creates a TranslationMap object which uses the providedHashMap. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn theLocaleStringsobject associated with the provided locale, ornullif it isn't found.Returns aSetwith the locales supported by theTranslationMap.inthashCode()booleanisEmpty()Returnstrueif the object contains no locale to LocaleStrings mappings.voidput(String locale, LocaleData.LocaleStrings localeStrings) Associates the specified locale with the specifiedLocaleData.LocaleStringsobject.toString()
-
Constructor Details
-
TranslationMap
public TranslationMap(int initialCapacity) Constructs an emptyTranslationMapwith the specified initial capacity.- Parameters:
initialCapacity- The initial capacity. Set to the number of expected locales.
-
TranslationMap
Creates a TranslationMap object which uses the providedHashMap.The HashMap should map locale codes to
LocaleData.LocaleStringslike this:{ 'fr' : LocaleStrings, 'de' : LocaleStrings, 'el' : LocaleStrings, } -
TranslationMap
Creates a new TranslationMap object by making a copy of the provided one.
-
-
Method Details
-
put
Associates the specified locale with the specifiedLocaleData.LocaleStringsobject. -
get
Return theLocaleStringsobject associated with the provided locale, ornullif it isn't found. -
getLocales
Returns aSetwith the locales supported by theTranslationMap. -
isEmpty
public boolean isEmpty()Returnstrueif the object contains no locale to LocaleStrings mappings.- Returns:
trueif it's empty,falseotherwise.
-
toString
-
equals
-
hashCode
public int hashCode()
-