Package org.assertj.core.api
Class AbstractBooleanAssert<SELF extends AbstractBooleanAssert<SELF>>
java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,Boolean>
org.assertj.core.api.AbstractBooleanAssert<SELF>
- Type Parameters:
SELF
- the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
- All Implemented Interfaces:
Assert<SELF,
,Boolean> Descriptable<SELF>
,ExtensionPoints<SELF,
Boolean>
- Direct Known Subclasses:
BooleanAssert
public abstract class AbstractBooleanAssert<SELF extends AbstractBooleanAssert<SELF>>
extends AbstractAssert<SELF,Boolean>
Base class for all implementations of assertions for
Boolean
s.- Author:
- Alex Ruiz, Yvonne Wang, David DIDIER, Ansgar Konermann, Mikhail Mazursky
-
Field Summary
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, info, myself, objects, throwUnsupportedExceptionOnEquals
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionisEqualTo
(boolean expected) Verifies that the actual value is equal to the given one.isFalse()
Verifies that the actual value isfalse
.isNotEqualTo
(boolean other) Verifies that the actual value is not equal to the given one.isTrue()
Verifies that the actual value istrue
.final SELF
usingComparator
(Comparator<? super Boolean> customComparator) Deprecated.Custom Comparator is not supported for Boolean comparison.final SELF
usingComparator
(Comparator<? super Boolean> customComparator, String customComparatorDescription) Deprecated.Custom Comparator is not supported for Boolean comparison.Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs
-
Constructor Details
-
AbstractBooleanAssert
-
-
Method Details
-
isTrue
Verifies that the actual value istrue
.Example:
// assertions will pass assertThat(true).isTrue(); assertThat(Boolean.TRUE).isTrue(); // assertions will fail assertThat(false).isTrue(); assertThat(Boolean.FALSE).isTrue();
- Returns:
this
assertion object.- Throws:
AssertionError
- if the actual value isnull
.AssertionError
- if the actual value is nottrue
.
-
isFalse
Verifies that the actual value isfalse
.Example:
// assertions will pass assertThat(false).isFalse(); assertThat(Boolean.FALSE).isFalse(); // assertions will fail assertThat(true).isFalse(); assertThat(Boolean.TRUE).isFalse();
- Returns:
this
assertion object.- Throws:
AssertionError
- if the actual value isnull
.AssertionError
- if the actual value is notfalse
.
-
isEqualTo
Verifies that the actual value is equal to the given one.Example:
// assertions will pass assertThat(true).isEqualTo(true); assertThat(Boolean.FALSE).isEqualTo(false); // assertions will fail assertThat(true).isEqualTo(false); assertThat(Boolean.TRUE).isEqualTo(false);
- Parameters:
expected
- the given value to compare the actual value to.- Returns:
this
assertion object.- Throws:
AssertionError
- if the actual value isnull
.AssertionError
- if the actual value is not equal to the given one.
-
isNotEqualTo
Verifies that the actual value is not equal to the given one.Example:
// assertions will pass assertThat(true).isNotEqualTo(false); assertThat(Boolean.FALSE).isNotEqualTo(true); // assertions will fail assertThat(true).isNotEqualTo(true); assertThat(Boolean.FALSE).isNotEqualTo(false);
- Parameters:
other
- the given value to compare the actual value to.- Returns:
this
assertion object.- Throws:
AssertionError
- if the actual value isnull
.AssertionError
- if the actual value is equal to the given one.
-
usingComparator
Deprecated.Custom Comparator is not supported for Boolean comparison.Do not use this method.- Specified by:
usingComparator
in interfaceAssert<SELF extends AbstractBooleanAssert<SELF>,
Boolean> - Overrides:
usingComparator
in classAbstractAssert<SELF extends AbstractBooleanAssert<SELF>,
Boolean> - Parameters:
customComparator
- the comparator to use for the incoming assertion checks.- Returns:
this
assertion object.- Throws:
UnsupportedOperationException
- if this method is called.
-
usingComparator
@Deprecated public final SELF usingComparator(Comparator<? super Boolean> customComparator, String customComparatorDescription) Deprecated.Custom Comparator is not supported for Boolean comparison.Do not use this method.- Specified by:
usingComparator
in interfaceAssert<SELF extends AbstractBooleanAssert<SELF>,
Boolean> - Overrides:
usingComparator
in classAbstractAssert<SELF extends AbstractBooleanAssert<SELF>,
Boolean> - Parameters:
customComparator
- the comparator to use for the incoming assertion checks.customComparatorDescription
- comparator description to be used in assertion error messages- Returns:
this
assertion object.- Throws:
UnsupportedOperationException
- if this method is called.
-