Package org.assertj.core.error
Class MessageFormatter
java.lang.Object
org.assertj.core.error.MessageFormatter
Formats the messages to be included in assertion errors.
- Author:
- Alex Ruiz
-
Method Summary
Modifier and TypeMethodDescriptionformat(Description d, Representation p, String format, Object... args) Interprets a printf-style formatStringfor failed assertion messages.static MessageFormatterinstance()
-
Method Details
-
instance
-
format
Interprets a printf-style formatStringfor failed assertion messages. It is similar to, except for:String.format(String, Object...)- the value of the given
is used as the first argument referenced in the format stringDescription - each of the arguments in the given array is converted to a
Stringby invoking.Representation.toStringOf(Object)
- Parameters:
d- the description of the failed assertion, may benull.p- the Representation usedformat- the format string.args- arguments referenced by the format specifiers in the format string.- Returns:
- A formatted
String. - Throws:
NullPointerException- if the format string isnull.
- the value of the given
-