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

public final class MessageArg<T> extends Object implements Serializable, CharSequence
Message Argument
Since:
1.54
Author:
Pavel Ponec
See Also:
  • Field Details

    • PARAM_BEG

      public static final String PARAM_BEG
      Two-character mark ("${") to introducing a template argument.
      See Also:
    • PARAM_END

      public static final char PARAM_END
      The mark ("}") to finishing a template argument.
      See Also:
  • Constructor Details

    • MessageArg

      public MessageArg(@NotNull @NotNull String name)
      Name constructor
    • MessageArg

      public MessageArg(@NotNull @NotNull String name, @Nullable @Nullable String format)
      Common constructor
      Parameters:
      name - Argument name
      format - Format syntax is described on java.util.Formatter
  • Method Details

    • getName

      @NotNull public @NotNull String getName()
      Get Name of argument
    • name

      @NotNull public @NotNull String name()
      An alias for method #getName()
    • getFormat

      @Nullable public @Nullable String getFormat()
      Get optional format of the argument
    • getCode

      @NotNull public @NotNull String getCode()
      A code name for a template
    • getValue

      public <T> T getValue(Map<String,Object> map)
      Get a value from a map
    • toString

      public String toString()
      Returns a code name
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object
    • length

      public int length()
      Specified by:
      length in interface CharSequence
    • charAt

      public char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • subSequence

      public CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • of

      public static <T> MessageArg<T> of(@NotNull @NotNull String name)
    • of

      public static <T> MessageArg<T> of(@NotNull @NotNull String name, @Nullable @Nullable String format)