@NotThreadSafe public class MultiLingualText extends TextProvider implements IMultiLingualText
Locale to the language dependent name.| Modifier and Type | Field and Description |
|---|---|
static IMultiLingualText |
EMPTY_MULTILINGUAL_TEXT
Default empty multilingual text - don't modify this object!!!
|
DE, EN| Constructor and Description |
|---|
MultiLingualText() |
MultiLingualText(IReadonlyMultiLingualText aMLT) |
MultiLingualText(ISimpleMultiLingualText aSimpleMLT)
Constructor especially for the static TextProvider.createXXX methods
|
MultiLingualText(Locale aContentLocale,
String sValue) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeNotifier(IChangeNotify<IMultiLingualText> aCallback)
Add a notification callback that is called, when the object is changed.
|
EChange |
addText(Locale aContentLocale,
String sText)
Add a text in the specified locale.
|
EChange |
assignFrom(IReadonlyMultiLingualText aMLT)
Assign all fields from the passed object.
|
EChange |
clear()
Reset the contents of the element to the after-construction state.
|
static IMultiLingualText |
createFromMap(Map<String,String> aMap) |
boolean |
equals(Object o) |
static IMultiLingualText |
getCopyWithLocales(IReadonlyMultiLingualText aMLT,
Collection<Locale> aContentLocales)
Get a copy of this object with the specified locales.
|
int |
hashCode() |
EChange |
removeText(Locale aContentLocale)
Remove the text with the specified locale.
|
EChange |
setText(Locale aContentLocale,
String sText)
Set a text in the specified locale.
|
addTextDE, addTextEN, containsLocale, containsLocaleWithFallback, create_DE_EN, create_DE, create_EN, getAllLocales, getLocaleCount, getMap, internalAddText, internalClear, internalGetAllLocales, internalGetLocaleToUseWithFallback, internalGetMap, internalGetText, internalRemoveText, internalSetText, isEmpty, isPerformConsistencyChecks, setPerformConsistencyChecks, size, toStringgetTextWithArgs, getTextWithLocaleFallbackAndArgsgetText, getTextWithLocaleFallbackclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMapgetTextWithArgs, getTextWithLocaleFallbackAndArgsgetText, getTextWithLocaleFallbackcontainsLocale, containsLocaleWithFallback, getAllLocales, getLocaleCountpublic static final IMultiLingualText EMPTY_MULTILINGUAL_TEXT
public MultiLingualText()
public MultiLingualText(@Nonnull ISimpleMultiLingualText aSimpleMLT)
aSimpleMLT - The simple multi lingual text to use.public MultiLingualText(@Nonnull IReadonlyMultiLingualText aMLT)
@Nonnull public EChange addText(@Nonnull Locale aContentLocale, @Nullable String sText)
IMultiLingualTextfalse is returned.addText in interface IMultiLingualTextaContentLocale - The locale in which the text should be set. May not be
null.sText - The text to be set. May be null.EChange.CHANGED if the text was added,
EChange.UNCHANGED otherwise.@Nonnull public EChange setText(@Nonnull Locale aContentLocale, @Nullable String sText)
IMultiLingualTextsetText in interface IMultiLingualTextaContentLocale - The locale in which the text should be set. May not be
null .sText - The text to be set. May be null.EChange.CHANGED if the text was set,
EChange.UNCHANGED otherwise.@Nonnull public EChange removeText(@Nonnull Locale aContentLocale)
IMultiLingualTextremoveText in interface IMultiLingualTextaContentLocale - The locale to be removed. May not be null.EChange.CHANGED if the text was remove,
EChange.UNCHANGED otherwise.@Nonnull public EChange clear()
IClearableclear in interface IClearableEChange.CHANGED if at least one element was cleared,
EChange.UNCHANGED otherwise.@Nonnull public EChange assignFrom(@Nonnull IReadonlyMultiLingualText aMLT)
IMultiLingualTextassignFrom in interface IMultiLingualTextaMLT - The object to read the content from. May not be null.EChange.CHANGED if the assignment changed anything,
EChange.UNCHANGED otherwise.public void addChangeNotifier(@Nonnull IChangeNotify<IMultiLingualText> aCallback)
IMultiLingualTextaddChangeNotifier in interface IMultiLingualTextaCallback - The callback to add. May not be null.public boolean equals(Object o)
equals in class TextProviderpublic int hashCode()
hashCode in class TextProvider@Nonnull public static IMultiLingualText createFromMap(@Nonnull Map<String,String> aMap)
@Nonnull public static IMultiLingualText getCopyWithLocales(@Nonnull IReadonlyMultiLingualText aMLT, @Nonnull Collection<Locale> aContentLocales)
aMLT - The initial multi lingual text.aContentLocales - The list of locales of which the strings are desired. May not be
null.null.Copyright © 2006–2015 phloc systems. All rights reserved.