Class NotFormatter

  • All Implemented Interfaces:
    ArgumentFormatter<java.lang.Boolean>

    public class NotFormatter
    extends BooleanFormatter
    Translates false to the word "not" and true to the empty word "".
     true:  ""
     false: "not"
     

    Example:

     then().the_coffee_should_$_be_served( coffeeServed )
     

    Result:

    coffeeServed == false

     then the coffee should not be served
     

    coffeeServed == true

     then the coffee should be served
     
    • Constructor Summary

      Constructors 
      Constructor Description
      NotFormatter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.lang.Boolean b, java.lang.String... args)
      Format a single argument by taking optional formatter arguments into account.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NotFormatter

        public NotFormatter()
    • Method Detail

      • format

        public java.lang.String format​(java.lang.Boolean b,
                                       java.lang.String... args)
        Description copied from interface: ArgumentFormatter
        Format a single argument by taking optional formatter arguments into account.
        Specified by:
        format in interface ArgumentFormatter<java.lang.Boolean>
        Overrides:
        format in class BooleanFormatter
        Parameters:
        b - the object to format
        args - optional arguments for the formatter to control the formatting.
        Returns:
        a formatted string