Package com.helger.commons.text.display
Class ConstantHasDisplayText
- java.lang.Object
-
- com.helger.commons.text.display.ConstantHasDisplayText
-
- All Implemented Interfaces:
IHasDisplayText
@Immutable @MustImplementEqualsAndHashcode public class ConstantHasDisplayText extends Object implements IHasDisplayText
An implementation of theIHasDisplayTextinterface that always returns a constant string. Use this only for texts that never need to be translated! Use this class if equals/hashCode is relevant- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description ConstantHasDisplayText(String sFixedText)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetDisplayText(Locale aContentLocale)inthashCode()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.text.display.IHasDisplayText
getAsHasText
-
-
-
-
Method Detail
-
getDisplayText
@Nullable public String getDisplayText(@Nonnull Locale aContentLocale)
- Specified by:
getDisplayTextin interfaceIHasDisplayText- Parameters:
aContentLocale- The locale to be used for resolving. May not benull.- Returns:
- The display text of the object in the given locale. May be
nullif the text could not be resolved in the passed locale.
-
-