Package org.fest.assertions.error
Class MessageFormatter
- java.lang.Object
-
- org.fest.assertions.error.MessageFormatter
-
public class MessageFormatter extends java.lang.Object
Formats the messages to be included in assertion errors.- Author:
- Alex Ruiz
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
format(Description d, java.lang.String format, java.lang.Object... args)
Interprets a printf-style formatString
for failed assertion messages.static MessageFormatter
instance()
-
-
-
Method Detail
-
instance
public static MessageFormatter instance()
-
format
public java.lang.String format(Description d, java.lang.String format, java.lang.Object... args)
Interprets a printf-style formatString
for 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
String
by invoking
.ToString.toStringOf(Object)
- Parameters:
d
- the description of the failed assertion, may benull
.format
- the format string.args
- arguments referenced by the format specifiers in the format string.- Returns:
- A formatted
String
. - Throws:
java.lang.NullPointerException
- if the format string isnull
.
- the value of the given
-
-