Package tools.msg
Class MessageArg<T>
java.lang.Object
tools.msg.MessageArg<T>
- Type Parameters:
T- The parameter has only a descriptive meaning with no functionality.
- All Implemented Interfaces:
Serializable,CharSequence
Message Argument
- Since:
- 1.54
- Author:
- Pavel Ponec
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMessageArg(@NotNull String name) Name constructorMessageArg(@NotNull String name, @Nullable String format) Common constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean@NotNull StringgetCode()A code name for a template@Nullable StringGet optional format of the argument@NotNull StringgetName()Get Name of argument<T> TGet a value from a mapcharcharAt(int index) intlength()@NotNull Stringname()An alias for method#getName()static <T> MessageArg<T>static <T> MessageArg<T>subSequence(int start, int end) toString()Returns a code nameMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
codePoints, chars, isEmpty
-
Field Details
-
PARAM_BEG
Two-character mark ("${") to introducing a template argument.- See Also:
-
PARAM_END
public static final char PARAM_ENDThe mark ("}") to finishing a template argument.- See Also:
-
-
Constructor Details
-
MessageArg
Name constructor -
MessageArg
Common constructor- Parameters:
name- Argument nameformat- Format syntax is described on java.util.Formatter
-
-
Method Details
-
getName
Get Name of argument -
name
An alias for method#getName() -
getFormat
Get optional format of the argument -
getCode
A code name for a template -
getValue
Get a value from a map -
toString
Returns a code name- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
equals
-
of
-
of
public static <T> MessageArg<T> of(@NotNull @NotNull String name, @Nullable @Nullable String format)
-