org.assertj.core.error
Class DescriptionFormatter

java.lang.Object
  extended by org.assertj.core.error.DescriptionFormatter

public class DescriptionFormatter
extends Object

Formats the Descriptions to be included in assertion errors.

Author:
Alex Ruiz

Method Summary
 String format(Description d)
          Formats the given Description by surrounding its text value with square brackets and adding a space at the end.
static DescriptionFormatter instance()
          Returns the singleton instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static DescriptionFormatter instance()
Returns the singleton instance of this class.

Returns:
the singleton instance of this class.

format

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 - the description to format. It can be null.
Returns:
the formatted description, or an empty String if the the Description is null.


Copyright © 2013–2015 AssertJ. All rights reserved.