T - the type of object this condition accepts.public abstract class Condition<T> extends java.lang.Object implements Descriptable<Condition<T>>
| Constructor and Description |
|---|
Condition()
Creates a new
Condition. |
Condition(Description description)
Creates a new
Condition. |
Condition(java.lang.String description)
Creates a new
Condition. |
| Modifier and Type | Method and Description |
|---|---|
Condition<T> |
as(Description newDescription)
Sets the description of this object.
|
Condition<T> |
as(java.lang.String newDescription)
Sets the description of this object.
|
Condition<T> |
describedAs(Description newDescription)
Alias for
since "as" is a keyword in Groovy. |
Condition<T> |
describedAs(java.lang.String newDescription)
Alias for
since "as" is a keyword in Groovy. |
Description |
description()
Returns the description of this condition.
|
abstract boolean |
matches(T value)
Verifies that the given value satisfies this condition.
|
java.lang.String |
toString() |
public Condition()
Condition. The default description of this condition will the simple name of the
condition's class.public Condition(java.lang.String description)
Condition.description - the description of this condition.java.lang.NullPointerException - if the given description is null.public Condition(Description description)
Condition.description - the description of this condition.java.lang.NullPointerException - if the given description is null.public Condition<T> describedAs(java.lang.String newDescription)
Descriptable.as(String) since "as" is a keyword in Groovy.describedAs in interface Descriptable<Condition<T>>newDescription - the new description to set.this object.public Condition<T> as(java.lang.String newDescription)
as in interface Descriptable<Condition<T>>newDescription - the new description to set.this object.Descriptable.describedAs(String)public Condition<T> describedAs(Description newDescription)
Descriptable.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.
describedAs in interface Descriptable<Condition<T>>newDescription - the new description to set.this object.public Condition<T> as(Description newDescription)
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.
as in interface Descriptable<Condition<T>>newDescription - the new description to set.this object.Descriptable.describedAs(Description)public Description description()
public abstract boolean matches(T value)
value - the value to verify.true if the given value satisfies this condition; false otherwise.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2007–2018. All rights reserved.