Interface Descriptable<S>

    • Method Detail

      • as

        S as​(java.lang.String description)
        Sets the description of this object.
        Parameters:
        description - the new description to set.
        Returns:
        this object.
        Throws:
        java.lang.NullPointerException - if the description is null.
        See Also:
        describedAs(String)
      • 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:
        java.lang.NullPointerException - if the description is null.
        See Also:
        describedAs(Description)
      • describedAs

        S describedAs​(java.lang.String description)
        Alias for as(String) since "as" is a keyword in Groovy.
        Parameters:
        description - the new description to set.
        Returns:
        this object.
        Throws:
        java.lang.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:
        java.lang.NullPointerException - if the description is null.