Package org.assertj.core.api
Class ClassBasedNavigableIterableAssert<SELF extends ClassBasedNavigableIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends java.lang.Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
-
- org.assertj.core.api.ClassBasedNavigableIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
-
- All Implemented Interfaces:
Assert<SELF,ACTUAL>,Descriptable<SELF>,EnumerableAssert<SELF,ELEMENT>,ExtensionPoints<SELF,ACTUAL>,ObjectEnumerableAssert<SELF,ELEMENT>
@Deprecated public class ClassBasedNavigableIterableAssert<SELF extends ClassBasedNavigableIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends java.lang.Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>> extends AbstractIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
Deprecated.UseFactoryBasedNavigableIterableAssertinstead.Build the Assert instance by reflection.- Since:
- 2.5.0 / 3.5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<ELEMENT_ASSERT>assertClassDeprecated.-
Fields inherited from class org.assertj.core.api.AbstractIterableAssert
iterables
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, customRepresentation, info, myself, objects, printAssertionsDescription, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Constructor Description ClassBasedNavigableIterableAssert(ACTUAL actual, java.lang.Class<?> selfType, java.lang.Class<ELEMENT_ASSERT> assertClass)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <ACTUAL extends java.lang.Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>
ClassBasedNavigableIterableAssert<?,ACTUAL,ELEMENT,ELEMENT_ASSERT>assertThat(ACTUAL actual, java.lang.Class<ELEMENT_ASSERT> assertClass)Deprecated.This was added to help creating type-specific assertions for the elements of anIterableinstance.private <V> ELEMENT_ASSERTbuildAssert(V value, java.lang.String description, java.lang.Class<?> clazz)Deprecated.protected SELFnewAbstractIterableAssert(java.lang.Iterable<? extends ELEMENT> iterable)Deprecated.This method is needed to build a new concrete instance of AbstractIterableAssert after a filtering operation is executed.ELEMENT_ASSERTtoAssert(ELEMENT value, java.lang.String description)Deprecated.This method is used in navigating assertions likeAbstractIterableAssert.first(),AbstractIterableAssert.last()andAbstractIterableAssert.element(int)to build the assertion for the given element navigated to.-
Methods inherited from class org.assertj.core.api.AbstractIterableAssert
allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, as, as, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsAnyOfForProxy, containsExactly, containsExactlyElementsOf, containsExactlyForProxy, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsExactlyInAnyOrderForProxy, containsForProxy, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyForProxy, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsOnlyOnceForProxy, containsSequence, containsSequence, containsSequenceForProxy, containsSubsequence, containsSubsequence, containsSubsequenceForProxy, describedAs, describedAs, doesNotContain, doesNotContainAnyElementsOf, doesNotContainForProxy, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSequenceForProxy, doesNotContainSubsequence, doesNotContainSubsequence, doesNotContainSubsequenceForProxy, doesNotHave, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doesNotHaveSameClassAs, doNotHave, element, element, elements, endsWith, endsWith, endsWithForProxy, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOn, filteredOn, filteredOnAssertions, filteredOnAssertions, filteredOnNull, first, first, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtractingForProxy, flatMap, flatMap, flatMap, flatMap, getComparatorsByType, getComparatorsForElementPropertyOrFieldTypes, has, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameClassAs, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, hasToString, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, is, isEmpty, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEmpty, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNullOrEmpty, isOfAnyClassIn, isSameAs, isSubsetOf, isSubsetOf, isSubsetOfForProxy, last, last, map, map, map, navigationDescription, newAbstractIterableAssertForProxy, noneMatch, noneMatch, noneSatisfy, noneSatisfy, overridingErrorMessage, satisfiesExactly, satisfiesExactly, satisfiesExactlyForProxy, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrderForProxy, satisfiesOnlyOnce, satisfiesOnlyOnce, satisfiesOnlyOnceForProxy, singleElement, singleElement, size, startsWith, startsWithForProxy, usingComparator, usingComparator, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, withAssertionState, withComparatorsForElementPropertyOrFieldNames, withComparatorsForElementPropertyOrFieldTypes, withFailMessage, withIterables, withThreadDumpOnError, withTypeComparators, zipSatisfy
-
Methods inherited from class org.assertj.core.api.AbstractAssert
actual, areEqual, asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, doesNotMatch, doesNotMatch, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, hasToString, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingEquals, usingEquals, withFailMessage, withRepresentation
-
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, describedAs
-
-
-
-
Field Detail
-
assertClass
private java.lang.Class<ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>> assertClass
Deprecated.
-
-
Constructor Detail
-
ClassBasedNavigableIterableAssert
public ClassBasedNavigableIterableAssert(ACTUAL actual, java.lang.Class<?> selfType, java.lang.Class<ELEMENT_ASSERT> assertClass)
Deprecated.
-
-
Method Detail
-
assertThat
@Deprecated public static <ACTUAL extends java.lang.Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>> ClassBasedNavigableIterableAssert<?,ACTUAL,ELEMENT,ELEMENT_ASSERT> assertThat(ACTUAL actual, java.lang.Class<ELEMENT_ASSERT> assertClass)
Deprecated.This was added to help creating type-specific assertions for the elements of anIterableinstance.Deprecated way:
However, there is a better way withIterable<String> hobbits = Set.of("frodo", "sam", "Pippin"); assertThat(hobbits, StringAssert.class).first() .startsWith("fro") .endsWith("do");InstanceOfAssertFactoryand the correspondingfirst(InstanceOfAssertFactory).New way:
The main advantage of the latter is easier discoverability and the use of InstanceOfAssertFactory which is the preferred way to create type-specific assertions in AssertJ API.assertThat(hobbits).first(STRING) // static import of InstanceOfAssertFactories.STRING .startsWith("fro") .endsWith("do");
-
newAbstractIterableAssert
protected SELF newAbstractIterableAssert(java.lang.Iterable<? extends ELEMENT> iterable)
Deprecated.Description copied from class:AbstractIterableAssertThis method is needed to build a new concrete instance of AbstractIterableAssert after a filtering operation is executed.If you create your own subclass of AbstractIterableAssert, simply returns an instance of it in this method.
- Specified by:
newAbstractIterableAssertin classAbstractIterableAssert<SELF extends ClassBasedNavigableIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends java.lang.Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>- Parameters:
iterable- the iterable used to build the concrete instance of AbstractIterableAssert- Returns:
- concrete instance of AbstractIterableAssert
-
toAssert
public ELEMENT_ASSERT toAssert(ELEMENT value, java.lang.String description)
Deprecated.Description copied from class:AbstractIterableAssertThis method is used in navigating assertions likeAbstractIterableAssert.first(),AbstractIterableAssert.last()andAbstractIterableAssert.element(int)to build the assertion for the given element navigated to.Typical implementation is returning an
ObjectAssertbut it is possible to return a more specialized assertions should you know what type of elements the iterables contain.- Specified by:
toAssertin classAbstractIterableAssert<SELF extends ClassBasedNavigableIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends java.lang.Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>- Parameters:
value- the element valuedescription- describes the element, ex: "check first element" forAbstractIterableAssert.first(), used in assertion description.- Returns:
- the assertion for the given element
-
buildAssert
private <V> ELEMENT_ASSERT buildAssert(V value, java.lang.String description, java.lang.Class<?> clazz)
Deprecated.
-
-