Top Description Fields Constructors Methods
org.assertj.core.error

public Class DescriptionFormatter

extends Object
Class Inheritance
Static Imports
org.assertj.core.util.Strings.isNullOrEmpty

Formats the Descriptions to be included in assertion errors.
Author
Alex Ruiz

Field Summary

Modifier and TypeField and Description
private static final DescriptionFormatter

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the formatted description, or an empty String if the Description is null.
format
(Description
the description to format. It can be null.
d
)

Formats the given Description by surrounding its text value with square brackets and adding a space at the end.

public static DescriptionFormatter

Returns:

the singleton instance of this class.
instance
()

Returns the singleton instance of this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final DescriptionFormatter INSTANCE

Constructor Detail

DescriptionFormatterback to summary
pack-priv DescriptionFormatter()
Annotations
@VisibleForTesting

Method Detail

formatback to summary
public String format(Description d)

Formats the given Description by surrounding its text value with square brackets and adding a space at the end.

Parameters
d:Description

the description to format. It can be null.

Returns:String

the formatted description, or an empty String if the Description is null.

instanceback to summary
public static DescriptionFormatter instance()

Returns the singleton instance of this class.

Returns:DescriptionFormatter

the singleton instance of this class.