Package com.helger.commons.text
Class AbstractMapBasedMultilingualText
java.lang.Object
com.helger.commons.text.AbstractHasText
com.helger.commons.text.AbstractReadOnlyMapBasedMultilingualText
com.helger.commons.text.AbstractMapBasedMultilingualText
- All Implemented Interfaces:
IClearable,IHasText,IHasTextWithArgs,IMultilingualText,IMutableMultilingualText,Serializable
- Direct Known Subclasses:
MultilingualText
@NotThreadSafe
public abstract class AbstractMapBasedMultilingualText
extends AbstractReadOnlyMapBasedMultilingualText
implements IMutableMultilingualText
A
Map based implementation of IMultilingualText that does
also provide writing methods to the outside and is only to be used as a
non-abstract base class.- Author:
- Philip Helger
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedProtected constructor that specifies the underlyingMapto use. -
Method Summary
Modifier and TypeMethodDescriptionfinal EChangeAdd a text in the specified locale.final EChangeassignFrom(IMultilingualText aMLT) Assign all fields from the passed object.booleaninthashCode()final EChangeReset the contents of the element to the after-construction state.final EChangeremoveText(Locale aContentLocale) Remove the text with the specified locale.final EChangeSet a text in the specified locale.toString()Methods inherited from class com.helger.commons.text.AbstractReadOnlyMapBasedMultilingualText
containsLocaleWithFallback, internalAddText, internalAddText, internalGetLocaleToUseWithFallback, internalGetText, internalSetText, isPerformConsistencyChecks, setPerformConsistencyChecks, textsMethods inherited from class com.helger.commons.text.AbstractHasText
getTextMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.text.IHasText
getAsHasDisplayText, getTextMethods inherited from interface com.helger.commons.text.IHasTextWithArgs
getAsHasDisplayTextWithArgs, getTextWithArgs, getTextWithArgsMethods inherited from interface com.helger.commons.text.IMultilingualText
containsLocaleWithFallback, texts
-
Constructor Details
-
AbstractMapBasedMultilingualText
protected AbstractMapBasedMultilingualText() -
AbstractMapBasedMultilingualText
Protected constructor that specifies the underlyingMapto use. Use this constructor to e.g. provide a concurrentHashMapor similar.- Parameters:
aMapToUse- The map to use. Must not benulland must be writable.
-
-
Method Details
-
addText
Description copied from interface:IMutableMultilingualTextAdd a text in the specified locale. If a text with the same locale is already present,falseis returned.- Specified by:
addTextin interfaceIMutableMultilingualText- Parameters:
aContentLocale- The locale in which the text should be set. May not benull.sText- The text to be set. May benull.- Returns:
EChange.CHANGEDif the text was added,EChange.UNCHANGEDotherwise.
-
setText
Description copied from interface:IMutableMultilingualTextSet a text in the specified locale. If a text with the same locale is already present, the old value is overwritten.- Specified by:
setTextin interfaceIMutableMultilingualText- Parameters:
aContentLocale- The locale in which the text should be set. May not benull.sText- The text to be set. May benull.- Returns:
EChange.CHANGEDif the text was set,EChange.UNCHANGEDotherwise.
-
removeText
Description copied from interface:IMutableMultilingualTextRemove the text with the specified locale.- Specified by:
removeTextin interfaceIMutableMultilingualText- Parameters:
aContentLocale- The locale to be removed. May not benull.- Returns:
EChange.CHANGEDif the text was remove,EChange.UNCHANGEDotherwise.
-
removeAll
Description copied from interface:IClearableReset the contents of the element to the after-construction state.- Specified by:
removeAllin interfaceIClearable- Returns:
EChange.CHANGEDif at least one element was cleared,EChange.UNCHANGEDotherwise.
-
assignFrom
Description copied from interface:IMutableMultilingualTextAssign all fields from the passed object. All existing texts are removed!- Specified by:
assignFromin interfaceIMutableMultilingualText- Parameters:
aMLT- The object to read the content from. May not benull.- Returns:
EChange.CHANGEDif the assignment changed anything,EChange.UNCHANGEDotherwise.
-
changeNotifyCallbacks
@Nonnull @ReturnsMutableObject("design") public final CallbackList<IChangeCallback<IMutableMultilingualText>> changeNotifyCallbacks()- Specified by:
changeNotifyCallbacksin interfaceIMutableMultilingualText- Returns:
- The change notify callbacks. Never
null.
-
equals
- Overrides:
equalsin classAbstractReadOnlyMapBasedMultilingualText
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractReadOnlyMapBasedMultilingualText
-
toString
- Overrides:
toStringin classAbstractReadOnlyMapBasedMultilingualText
-