Interface Descriptable<S>

Type Parameters:
S - the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
All Known Subinterfaces:
Assert<S,A>
All Known Implementing Classes:
AbstractAssert, AbstractComparableAssert, AbstractIterableAssert, AbstractUnevenComparableAssert, AllOf, AnyOf, BigDecimalAssert, BooleanArrayAssert, BooleanAssert, ByteArrayAssert, ByteAssert, CharacterAssert, CharArrayAssert, Condition, DateAssert, DoesNotHave, DoubleArrayAssert, DoubleAssert, FileAssert, FloatArrayAssert, FloatAssert, InputStreamAssert, IntArrayAssert, IntegerAssert, IterableAssert, Join, ListAssert, LongArrayAssert, LongAssert, MapAssert, Negative, Not, ObjectArrayAssert, ObjectAssert, ShortArrayAssert, ShortAssert, StringAssert, ThrowableAssert

public interface Descriptable<S>
An object that has a description.
Author:
Alex Ruiz, Yvonne Wang
  • Method Details

    • as

      S as(String description)
      Sets the description of this object.
      Parameters:
      description - the new description to set.
      Returns:
      this object.
      Throws:
      NullPointerException - if the description is null.
      See Also:
    • as

      S as(Description description)
      Sets the description of this object. To remove or clear the description, pass a EmptyTextDescription as argument.

      This overloaded version of "describedAs" offers more flexibility than the one taking a String by allowing users to pass their own implementation of a description. For example, a description that creates its value lazily, only when an assertion failure occurs.

      Parameters:
      description - the new description to set.
      Returns:
      this object.
      Throws:
      NullPointerException - if the description is null.
      See Also:
    • describedAs

      S describedAs(String description)
      Alias for as(String) since "as" is a keyword in Groovy.
      Parameters:
      description - the new description to set.
      Returns:
      this object.
      Throws:
      NullPointerException - if the description is null.
    • describedAs

      S describedAs(Description description)
      Alias for as(String) since "as" is a keyword in Groovy. To remove or clear the description, pass a EmptyTextDescription as argument.

      This overloaded version of "describedAs" offers more flexibility than the one taking a String by allowing users to pass their own implementation of a description. For example, a description that creates its value lazily, only when an assertion failure occurs.

      Parameters:
      description - the new description to set.
      Returns:
      this object.
      Throws:
      NullPointerException - if the description is null.