Class CompositeMultilingualText
java.lang.Object
com.aquima.interactions.foundation.text.CompositeMultilingualText
- All Implemented Interfaces:
IMultilingualText
,Serializable
This implementation of IMultilingualText can be used to combine multiple multilingual texts with a specified seperator.
Examples (where "a","b","c" are texts for a specific language):
- ["a", "b", "c"] with seperator , => "a,b,c"
- ["a", "", "c"] with seperator , => "a,c"
- ["a", " ", "c"] with seperator , => "a,c"
- ["a", "b", " "] with seperator , => "a,b"
- ["", "b", " "] with seperator , => "b"
- Since:
- 7.1
- Author:
- J. van Leuven
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCompositeMultilingualText
(IMultilingualText[] texts, String seperator) Construct a composite multilingual text with multiple texts.CompositeMultilingualText
(IMultilingualText text1, IMultilingualText text2, String seperator) Construct a composite multilingual text with two texts. -
Method Summary
-
Constructor Details
-
CompositeMultilingualText
public CompositeMultilingualText(IMultilingualText text1, IMultilingualText text2, String seperator) Construct a composite multilingual text with two texts.- Parameters:
text1
- First text, may not be nulltext2
- Second text, may not be nullseperator
- Seperator, may not be null
-
CompositeMultilingualText
Construct a composite multilingual text with multiple texts.- Parameters:
texts
- Array of texts, may not be null, an empty array or contain null objects.seperator
- Seperator, may not be null
-
-
Method Details
-
getValue
-
getValue
-
getValue
Description copied from interface:IMultilingualText
Retrieves the text for the specified language code. If desired one can return a constant text independent of language code.- Specified by:
getValue
in interfaceIMultilingualText
- Parameters:
languageCode
- never null- Returns:
- The text, can return a null pointer.
-
getValue
Description copied from interface:IMultilingualText
Retrieves the text for the specified language code. If this text does not exist, the text of the fallback language code is being retrieved. If desired one can return a constant text independent of language code.- Specified by:
getValue
in interfaceIMultilingualText
- Parameters:
languageCode
- never nullfallbackLanguageCode
- never null- Returns:
- The text, can return a null pointer.
-
hashCode
public int hashCode() -
equals
-
getLanguageCodes
Description copied from interface:IMultilingualText
Retrieves the language codes.- Specified by:
getLanguageCodes
in interfaceIMultilingualText
- Returns:
- The text, can't return null.
-
getDefaultText
Description copied from interface:IMultilingualText
Returns the default text.- Specified by:
getDefaultText
in interfaceIMultilingualText
- Returns:
- The default text, can be null.
-