Class DescriptionFormatter


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

      • DescriptionFormatter

        DescriptionFormatter()
    • 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 Description is null.