Package com.helger.commons.text.display
Class HasDisplayTextWithArgs
- java.lang.Object
-
- com.helger.commons.text.display.HasDisplayTextWithArgs
-
- All Implemented Interfaces:
IHasDisplayText
@Immutable public class HasDisplayTextWithArgs extends Object implements IHasDisplayText
A special implementation ofIHasDisplayTextthat encapsulates arguments to be put into the message.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description HasDisplayTextWithArgs(IHasDisplayText aParentText, Object... aArgs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]getAllArgs()Get all arguments from the constructor.StringgetDisplayText(Locale aContentLocale)IHasDisplayTextgetParentText()StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.text.display.IHasDisplayText
getAsHasText
-
-
-
-
Constructor Detail
-
HasDisplayTextWithArgs
public HasDisplayTextWithArgs(@Nonnull IHasDisplayText aParentText, @Nonnull @Nonempty Object... aArgs)
-
-
Method Detail
-
getParentText
@Nonnull public IHasDisplayText getParentText()
-
getAllArgs
@Nonnull @Nonempty @ReturnsMutableCopy public Object[] getAllArgs()
Get all arguments from the constructor.- Returns:
- a copy of all arguments. Neither
nullnor empty-
-
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.
-
-