Interface PreMessage

All Known Implementing Classes:
SimpleMessage, SimpleMessage.Ping, SimplePreMessage

@CyclicDependency(reason="factory method") public interface PreMessage
Represent a submessage of a message or a negative result of a test. Consists of a text and a list of arguments. The text should include format codes which correspond to the types of the arguments.
Since:
1.3
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Return the formatting of the string and its arguments.
    static String
    Executes formatting recursively.
    Returns an access to the arguments.
    Return the unformatted text component.
    static PreMessage
    preMessage(String text, Object... args)
    Factory method.
  • Method Details

    • getArgs

      Object[] getArgs()
      Returns an access to the arguments. Possibly this is not an access which allows to modify this instance.
      Returns:
      an access to the arguments.
    • getText

      String getText()
      Return the unformatted text component.
    • format

      default String format()
      Return the formatting of the string and its arguments.
    • format

      static String format(PreMessage pm)
      Executes formatting recursively. Any PreMessage contained in the arguments is formatted, and the result is used to replace a "%s" format operand.
      (Please note that translation into different languages is not supported by this simple variant.)
    • preMessage

      static PreMessage preMessage(String text, Object... args)
      Factory method.