public abstract class AbstractReadOnlyMapBasedMultilingualText extends AbstractHasText implements IMultilingualText, Serializable
Map based implementation of IMultilingualText that does not
provide writing methods to the outside and is only to be used as a
non-abstract base class.| Modifier | Constructor and Description |
|---|---|
|
AbstractReadOnlyMapBasedMultilingualText() |
protected |
AbstractReadOnlyMapBasedMultilingualText(ICommonsOrderedMap<Locale,String> aMapToUse)
Protected constructor that specifies the underlying
Map to use. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsLocaleWithFallback(Locale aContentLocale)
Check if the passed locale is directly or by fallback contained.
|
boolean |
equals(Object o) |
int |
hashCode() |
protected void |
internalAddText(Locale aContentLocale,
String sValue) |
protected void |
internalAddText(Map.Entry<Locale,String> aEntry) |
protected Locale |
internalGetLocaleToUseWithFallback(Locale aContentLocale)
Determine the locale to use.
|
protected String |
internalGetText(Locale aContentLocale)
Main text resolving.
|
protected void |
internalSetText(Locale aContentLocale,
String sValue) |
static boolean |
isPerformConsistencyChecks() |
static void |
setPerformConsistencyChecks(boolean bPerformConsistencyChecks)
Enable or disable the internal consistency checks.
|
ICommonsOrderedMap<Locale,String> |
texts() |
String |
toString() |
getTextclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAsHasDisplayTextWithArgs, getTextWithArgs, getTextWithArgsgetAsHasDisplayText, getComparatorCollating, getTextpublic AbstractReadOnlyMapBasedMultilingualText()
protected AbstractReadOnlyMapBasedMultilingualText(@Nonnull ICommonsOrderedMap<Locale,String> aMapToUse)
Map to use. Use
this constructor to e.g. provide a concurrent HashMap or similar.aMapToUse - The map to use. Must not be null and must be writable.public static void setPerformConsistencyChecks(boolean bPerformConsistencyChecks)
bPerformConsistencyChecks - true to enable them, false to disable
them.public static boolean isPerformConsistencyChecks()
true if consistency checks are enabled,
false if not. The default value is
GlobalDebug.isDebugMode().protected final void internalAddText(@Nonnull Locale aContentLocale, @Nullable String sValue)
protected final void internalSetText(@Nonnull Locale aContentLocale, @Nullable String sValue)
@Nullable protected final String internalGetText(@Nonnull Locale aContentLocale)
AbstractHasTextinternalGetText in class AbstractHasTextaContentLocale - Locale to use. This is the locale resolved internally. Never
null.null if no such text present in the passed locale@Nullable protected final Locale internalGetLocaleToUseWithFallback(@Nonnull Locale aContentLocale)
AbstractHasTextinternalGetLocaleToUseWithFallback in class AbstractHasTextaContentLocale - Requested locale. Never null.null.public final boolean containsLocaleWithFallback(@Nullable Locale aContentLocale)
IMultilingualTextcontainsLocaleWithFallback in interface IMultilingualTextaContentLocale - The locale to check. May be null.true if the locale is contained, false if
not.@Nonnull @ReturnsMutableObject public final ICommonsOrderedMap<Locale,String> texts()
texts in interface IMultilingualTextnull.@OverridingMethodsMustInvokeSuper public boolean equals(Object o)
@OverridingMethodsMustInvokeSuper public int hashCode()
@OverridingMethodsMustInvokeSuper public String toString()
Copyright © 2014–2022 Philip Helger. All rights reserved.