Class LocalizedString
java.lang.Object
com.sportradar.livedata.sdk.feed.common.entities.LocalizedString
- All Implemented Interfaces:
- Serializable
Localized string container where a string is represented by its international value and
 a collection of translations to other languages.
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedFor SerializableLocalizedString(String internationalValue) Constructs a new localized string.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddTranslation(String lang, String translation) Adds a new translation to the string.booleanequals(LocalizedString other) Check for equality.booleanCheck for equality.Available language codes this instance is translated to.Returns international string.getTranslation(String lang) Returns translation for the specified language.inthashCode()Serves as a hash function for a particular type.toString()Returns international string, if available.
- 
Constructor Details- 
LocalizedStringConstructs a new localized string.- Parameters:
- internationalValue- International value
 
- 
LocalizedStringprotected LocalizedString()For Serializable
 
- 
- 
Method Details- 
addTranslationAdds a new translation to the string. Overrides the previous language translations if existed.- Parameters:
- lang- Language code
- translation- Translation for this language
 
- 
equalsCheck for equality.Note : Compares by the international value only. - Parameters:
- other- other object
- Returns:
- true when equal; false else
 
- 
getAvailableTranslationLanguagesAvailable language codes this instance is translated to. For instance "de", "en" and so on.Note: Might be empty, then you still have the international name - Returns:
- all available language codes
 
- 
getInternationalReturns international string.- Returns:
- international value
 
- 
getTranslationReturns translation for the specified language. Falls back to international string if translation does not exist.- Parameters:
- lang- Language code (null for international string)
- Returns:
- Translation for the specified language.
 
- 
hashCodepublic int hashCode()Serves as a hash function for a particular type.
- 
equalsCheck for equality.
- 
toStringReturns international string, if available.
 
-