Package org.fest.assertions
Class Formatting
java.lang.Object
org.fest.assertions.Formatting
Provides utility methods related to formatting.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static String
createMessageFrom
(Description description, Object[] message) private static String
static String
Formats the given message: if it isnull
or empty, an emptyString
is returned, otherwise uses the following format:static String
format
(Description description, String message) Returns the given message formatted as follows:static String
inBrackets
(Object o) Returns theString
representation of the given object in between brackets ("<" and ">").static String
valueOf
(Description description) Returns the value of the given
.Description
-
Field Details
-
EMPTY_MESSAGE
- See Also:
-
-
Constructor Details
-
Formatting
private Formatting()
-
-
Method Details
-
createMessageFrom
-
format
Returns the given message formatted as follows:[description] message.
- Parameters:
description
- the description of the actual value in the failed assertion. It can benull
.message
- the message to format.- Returns:
- the formatted message.
- Since:
- 1.2
-
valueOf
Returns the value of the given
.Description
- Parameters:
description
- the givenDescription
.- Returns:
- the value of the given
Description
, ornull
if the givenDescription
isnull
.
-
format
Formats the given message:- if it is
null
or empty, an emptyString
is returned, otherwise uses the following format:[message]{whitespace}
- Parameters:
message
- the message to format.- Returns:
- the formatted message.
- if it is
-
inBrackets
Returns theString
representation of the given object in between brackets ("<" and ">"). This method has special support for arrays,Class<?>
,Collection
s,Map
s,File
s andDimension
s. For any other types, this method simply calls itstoString
implementation.- Parameters:
o
- the given object.- Returns:
- the
String
representation of the given object in between brackets.
-
doBracketAround
-