Class DescriptionFormatter


  • public class DescriptionFormatter
    extends java.lang.Object
    Formats the Descriptions to be included in assertion errors.
    Author:
    Alex Ruiz
    • Method Detail

      • instance

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

        public java.lang.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.