Package org.assertj.core.api
Class AbstractBooleanAssert<SELF extends AbstractBooleanAssert<SELF>>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,java.lang.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,java.lang.Boolean>,Descriptable<SELF>,ExtensionPoints<SELF,java.lang.Boolean>
- Direct Known Subclasses:
BooleanAssert
public abstract class AbstractBooleanAssert<SELF extends AbstractBooleanAssert<SELF>> extends AbstractAssert<SELF,java.lang.Boolean>
Base class for all implementations of assertions forBooleans.
-
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, customRepresentation, info, myself, objects, printAssertionsDescription, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractBooleanAssert(java.lang.Boolean actual, java.lang.Class<?> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SELFisEqualTo(boolean expected)Verifies that the actual value is equal to the given one.SELFisFalse()Verifies that the actual value isfalse.SELFisNotEqualTo(boolean other)Verifies that the actual value is not equal to the given one.SELFisTrue()Verifies that the actual value istrue.SELFusingComparator(java.util.Comparator<? super java.lang.Boolean> customComparator)Deprecated.Custom Comparator is not supported for Boolean comparison.SELFusingComparator(java.util.Comparator<? super java.lang.Boolean> customComparator, java.lang.String customComparatorDescription)Deprecated.Custom Comparator is not supported for Boolean comparison.-
Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, 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, usingEquals, usingEquals, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, 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, describedAs
-
-
-
-
Method Detail
-
isTrue
public SELF isTrue()
Verifies that the actual value istrue.Example:
// assertions succeed: assertThat(true).isTrue(); assertThat(Boolean.TRUE).isTrue(); // assertions fail: assertThat(false).isTrue(); assertThat(Boolean.FALSE).isTrue();- Returns:
thisassertion object.- Throws:
java.lang.AssertionError- if the actual value isnull.java.lang.AssertionError- if the actual value is nottrue.
-
isFalse
public SELF isFalse()
Verifies that the actual value isfalse.Example:
// assertions succeed: assertThat(false).isFalse(); assertThat(Boolean.FALSE).isFalse(); // assertions fail: assertThat(true).isFalse(); assertThat(Boolean.TRUE).isFalse();- Returns:
thisassertion object.- Throws:
java.lang.AssertionError- if the actual value isnull.java.lang.AssertionError- if the actual value is notfalse.
-
isEqualTo
public SELF isEqualTo(boolean expected)
Verifies that the actual value is equal to the given one.Example:
// assertions succeed: assertThat(true).isEqualTo(true); assertThat(Boolean.FALSE).isEqualTo(false); // assertions fail: assertThat(true).isEqualTo(false); assertThat(Boolean.TRUE).isEqualTo(false);- Parameters:
expected- the given value to compare the actual value to.- Returns:
thisassertion object.- Throws:
java.lang.AssertionError- if the actual value isnull.java.lang.AssertionError- if the actual value is not equal to the given one.
-
isNotEqualTo
public SELF isNotEqualTo(boolean other)
Verifies that the actual value is not equal to the given one.Example:
// assertions succeed: assertThat(true).isNotEqualTo(false); assertThat(Boolean.FALSE).isNotEqualTo(true); // assertions fail: assertThat(true).isNotEqualTo(true); assertThat(Boolean.FALSE).isNotEqualTo(false);- Parameters:
other- the given value to compare the actual value to.- Returns:
thisassertion object.- Throws:
java.lang.AssertionError- if the actual value isnull.java.lang.AssertionError- if the actual value is equal to the given one.
-
usingComparator
@Deprecated public final SELF usingComparator(java.util.Comparator<? super java.lang.Boolean> customComparator)
Deprecated.Custom Comparator is not supported for Boolean comparison.Do not use this method.- Specified by:
usingComparatorin interfaceAssert<SELF extends AbstractBooleanAssert<SELF>,java.lang.Boolean>- Overrides:
usingComparatorin classAbstractAssert<SELF extends AbstractBooleanAssert<SELF>,java.lang.Boolean>- Parameters:
customComparator- the comparator to use for the incoming assertion checks.- Returns:
thisassertion object.- Throws:
java.lang.UnsupportedOperationException- if this method is called.
-
usingComparator
@Deprecated public final SELF usingComparator(java.util.Comparator<? super java.lang.Boolean> customComparator, java.lang.String customComparatorDescription)
Deprecated.Custom Comparator is not supported for Boolean comparison.Do not use this method.- Specified by:
usingComparatorin interfaceAssert<SELF extends AbstractBooleanAssert<SELF>,java.lang.Boolean>- Overrides:
usingComparatorin classAbstractAssert<SELF extends AbstractBooleanAssert<SELF>,java.lang.Boolean>- Parameters:
customComparator- the comparator to use for the incoming assertion checks.customComparatorDescription- comparator description to be used in assertion error messages- Returns:
thisassertion object.- Throws:
java.lang.UnsupportedOperationException- if this method is called.
-
-