Top Description Fields Constructors Methods
org.assertj.core.internal

public Class Conditions

extends Object
Class Inheritance
Static Imports
java.lang.String.format, java.util.Objects.requireNonNull, org.assertj.core.error.ShouldBe.shouldBe, .ShouldHave.shouldHave, .ShouldNotBe.shouldNotBe, .ShouldNotHave.shouldNotHave, .ShouldSatisfy.shouldSatisfy

Verifies that a value satisfies a Condition.
Author
Alex Ruiz

Field Summary

Modifier and TypeField and Description
pack-priv Failures
private static final Conditions

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public <
the type of the actual value and the type of values that given Condition takes.
T
>
void
assertDoesNotHave(AssertionInfo
contains information about the assertion.
info
,
T
the actual value.
actual
,
Condition<? super T>
the given Condition.
condition
)

Asserts that the actual value does not satisfy the given Condition.

public <
the type of the actual value and the type of values that given Condition takes.
T
>
void
assertHas(AssertionInfo
contains information about the assertion.
info
,
T
the actual value.
actual
,
Condition<? super T>
the given Condition.
condition
)

Asserts that the actual value satisfies the given Condition.

public <
the type of the actual value and the type of values that given Condition takes.
T
>
void
assertIs(AssertionInfo
contains information about the assertion.
info
,
T
the actual value.
actual
,
Condition<? super T>
the given Condition.
condition
)

Asserts that the actual value satisfies the given Condition.

public <
the type of the actual value and the type of values that given Condition takes.
T
>
void
assertIsNot(AssertionInfo
contains information about the assertion.
info
,
T
the actual value.
actual
,
Condition<? super T>
the given Condition.
condition
)

Asserts that the actual value does not satisfy the given Condition.

public void
assertIsNotNull(Condition<?>
the given Condition.
condition
)

Asserts the given Condition is not null.

public void
assertIsNotNull(Condition<?>
the given Condition.
condition
,
String format, Object... args)

Asserts the given Condition is not null.

public <T> void
assertSatisfies(AssertionInfo info, T actual, Condition<? super T> condition)

public static Conditions

Returns:

the singleton instance of this class.
instance
()

Returns the singleton instance of this class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

failuresback to summary
pack-priv Failures failures
Annotations
@VisibleForTesting
INSTANCEback to summary
private static final Conditions INSTANCE

Constructor Detail

Conditionsback to summary
pack-priv Conditions()
Annotations
@VisibleForTesting

Method Detail

assertDoesNotHaveback to summary
public <T> void assertDoesNotHave(AssertionInfo info, T actual, Condition<? super T> condition)

Asserts that the actual value does not satisfy the given Condition.

Parameters
<T>
the type of the actual value and the type of values that given Condition takes.
info:AssertionInfo

contains information about the assertion.

actual:T

the actual value.

condition:Condition<? super T>

the given Condition.

Exceptions
NullPointerException:
if the given Condition is null.
AssertionError:
if the actual value satisfies the given Condition.
assertHasback to summary
public <T> void assertHas(AssertionInfo info, T actual, Condition<? super T> condition)

Asserts that the actual value satisfies the given Condition.

Parameters
<T>
the type of the actual value and the type of values that given Condition takes.
info:AssertionInfo

contains information about the assertion.

actual:T

the actual value.

condition:Condition<? super T>

the given Condition.

Exceptions
NullPointerException:
if the given Condition is null.
AssertionError:
if the actual value does not satisfy the given Condition.
assertIsback to summary
public <T> void assertIs(AssertionInfo info, T actual, Condition<? super T> condition)

Asserts that the actual value satisfies the given Condition.

Parameters
<T>
the type of the actual value and the type of values that given Condition takes.
info:AssertionInfo

contains information about the assertion.

actual:T

the actual value.

condition:Condition<? super T>

the given Condition.

Exceptions
NullPointerException:
if the given Condition is null.
AssertionError:
if the actual value does not satisfy the given Condition.
assertIsNotback to summary
public <T> void assertIsNot(AssertionInfo info, T actual, Condition<? super T> condition)

Asserts that the actual value does not satisfy the given Condition.

Parameters
<T>
the type of the actual value and the type of values that given Condition takes.
info:AssertionInfo

contains information about the assertion.

actual:T

the actual value.

condition:Condition<? super T>

the given Condition.

Exceptions
NullPointerException:
if the given Condition is null.
AssertionError:
if the actual value satisfies the given Condition.
assertIsNotNullback to summary
public void assertIsNotNull(Condition<?> condition)

Asserts the given Condition is not null.

Parameters
condition:Condition<?>

the given Condition.

Exceptions
NullPointerException:
if the given Condition is null.
assertIsNotNullback to summary
public void assertIsNotNull(Condition<?> condition, String format, Object... args)

Asserts the given Condition is not null.

Parameters
condition:Condition<?>

the given Condition.

format:String

as in String#format(String, Object...)

args:Object[]

as in String#format(String, Object...)

Exceptions
NullPointerException:
if the given Condition is null.
assertSatisfiesback to summary
public <T> void assertSatisfies(AssertionInfo info, T actual, Condition<? super T> condition)
instanceback to summary
public static Conditions instance()

Returns the singleton instance of this class.

Returns:Conditions

the singleton instance of this class.