Class FormattedMessage

  • All Implemented Interfaces:
    Serializable, Message


    public class FormattedMessage
    extends Object
    implements Message
    Handles messages that contain a format String. Dynamically determines if the format conforms to MessageFormat or String.format and if not then uses ParameterizedMessage to format.
    See Also:
    Serialized Form
    • Constructor Detail

      • FormattedMessage

        public FormattedMessage(String messagePattern,
                                Object[] arguments,
                                Throwable throwable)
      • FormattedMessage

        public FormattedMessage(String messagePattern,
                                Object[] arguments)
      • FormattedMessage

        public FormattedMessage(String messagePattern,
                                Object arg)
        Constructor with a pattern and a single parameter.
        Parameters:
        messagePattern - The message pattern.
        arg - The parameter.
      • FormattedMessage

        public FormattedMessage(String messagePattern,
                                Object arg1,
                                Object arg2)
        Constructor with a pattern and two parameters.
        Parameters:
        messagePattern - The message pattern.
        arg1 - The first parameter.
        arg2 - The second parameter.
    • Method Detail

      • getFormattedMessage

        public String getFormattedMessage()
        Returns the formatted message.
        Specified by:
        getFormattedMessage in interface  Message
        Returns:
        the formatted message.
      • getFormat

        public String getFormat()
        Returns the message pattern.
        Specified by:
        getFormat in interface  Message
        Returns:
        the message pattern.
      • getParameters

        public Object[] getParameters()
        Returns the message parameters.
        Specified by:
        getParameters in interface  Message
        Returns:
        the message parameters.
      • equals

        public boolean equals(Object o)
      • hashCode

        public int hashCode()
      • toString

        public String toString()