public class ProxyableListAssert<ELEMENT> extends FactoryBasedNavigableListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
List
s without any final methods to allow proxying.iterables
actual, info, myself, throwUnsupportedExceptionOnEquals
Modifier | Constructor and Description |
---|---|
protected |
ProxyableListAssert(DoubleStream actual) |
protected |
ProxyableListAssert(IntStream actual) |
|
ProxyableListAssert(List<? extends ELEMENT> actual) |
protected |
ProxyableListAssert(LongStream actual) |
protected |
ProxyableListAssert(Stream<? extends ELEMENT> actual) |
Modifier and Type | Method and Description |
---|---|
ProxyableListAssert<ELEMENT> |
isEqualTo(Object expected)
Verifies that the actual value is equal to the given one.
|
ProxyableListAssert<ELEMENT> |
isExactlyInstanceOf(Class<?> type)
Verifies that the actual value is exactly an instance of the given type.
|
ProxyableListAssert<ELEMENT> |
isInstanceOf(Class<?> type)
Verifies that the actual value is an instance of the given type.
|
ProxyableListAssert<ELEMENT> |
isInstanceOfAny(Class<?>... types)
Verifies that the actual value is an instance of any of the given types.
|
ProxyableListAssert<ELEMENT> |
isNotExactlyInstanceOf(Class<?> type)
Verifies that the actual value is not exactly an instance of given type.
|
ProxyableListAssert<ELEMENT> |
isNotInstanceOf(Class<?> type)
Verifies that the actual value is not an instance of the given type.
|
ProxyableListAssert<ELEMENT> |
isNotInstanceOfAny(Class<?>... types)
Verifies that the actual value is not an instance of any of the given types.
|
ProxyableListAssert<ELEMENT> |
isNotOfAnyClassIn(Class<?>... types)
Verifies that the actual value type is not in given types.
|
ProxyableListAssert<ELEMENT> |
isNotSameAs(Object expected)
Verifies that the actual value is not the same as the given one, ie using == comparison.
|
ProxyableListAssert<ELEMENT> |
isOfAnyClassIn(Class<?>... types)
Verifies that the actual value type is in given types.
|
ProxyableListAssert<ELEMENT> |
isSameAs(Object expected)
Verifies that the actual value is the same as the given one, ie using == comparison.
|
protected ProxyableListAssert<ELEMENT> |
newAbstractIterableAssert(Iterable<? extends ELEMENT> iterable) |
protected <ELEMENT2> AbstractListAssert<?,List<? extends ELEMENT2>,ELEMENT2,ObjectAssert<ELEMENT2>> |
newListAssertInstance(List<? extends ELEMENT2> newActual)
Create a
AbstractListAssert . |
ProxyableListAssert<ELEMENT> |
startsWith(ELEMENT... sequence)
Verifies that the actual group starts with the given sequence of objects, without any other objects between them.
|
toAssert
as, as, contains, describedAs, describedAs, doesNotContain, doesNotHave, doesNotHaveSameClassAs, has, has, hasSameClassAs, hasToString, is, is, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isSorted, isSortedAccordingTo, overridingErrorMessage, satisfies, usingComparator, usingComparator, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, withFailMessage, withThreadDumpOnError
allMatch, allMatch, allSatisfy, anyMatch, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsExactly, containsExactlyElementsOf, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyNulls, containsOnlyOnce, containsSequence, containsSequence, containsSubsequence, containsSubsequence, doesNotContain, doesNotContainAnyElementsOf, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSubsequence, doesNotContainSubsequence, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doNotHave, element, endsWith, endsWith, extracting, extracting, extracting, extracting, extracting, extracting, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOn, filteredOnAssertions, filteredOnNull, first, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, getComparatorsByType, getComparatorsForElementPropertyOrFieldTypes, hasAtLeastOneElementOfType, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, isEmpty, isNotEmpty, isNullOrEmpty, isSubsetOf, isSubsetOf, last, navigationDescription, noneMatch, noneSatisfy, size, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, zipSatisfy
asList, asString, descriptionText, equals, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, isInstanceOfSatisfying, isNull, matches, matches, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, throwAssertionError, withRepresentation
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
allMatch, allMatch, allSatisfy, anyMatch, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsExactly, containsExactlyElementsOf, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyNulls, containsOnlyOnce, containsSequence, containsSequence, containsSubsequence, containsSubsequence, doesNotContain, doesNotContainAnyElementsOf, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSubsequence, doesNotContainSubsequence, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doNotHave, endsWith, endsWith, hasAtLeastOneElementOfType, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameElementsAs, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, isSubsetOf, isSubsetOf, noneMatch, noneSatisfy
hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, isEmpty, isNotEmpty, isNullOrEmpty
protected ProxyableListAssert(IntStream actual)
protected ProxyableListAssert(LongStream actual)
protected ProxyableListAssert(DoubleStream actual)
protected <ELEMENT2> AbstractListAssert<?,List<? extends ELEMENT2>,ELEMENT2,ObjectAssert<ELEMENT2>> newListAssertInstance(List<? extends ELEMENT2> newActual)
AbstractAssert
AbstractListAssert
.
Implementations need to redefine either to be proxy friendly (i.e. no final assertion methods like ProxyableListAssert
)
or generic vararg friendly (to use SafeVarargs
annotation which requires final method)like ListAssert
.
The default implementation will assume that this concrete implementation is NOT a soft assertion.
newListAssertInstance
in class AbstractAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
ELEMENT2
- the type of elements.newActual
- new valueAbstractListAssert
.protected ProxyableListAssert<ELEMENT> newAbstractIterableAssert(Iterable<? extends ELEMENT> iterable)
newAbstractIterableAssert
in class FactoryBasedNavigableListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
public ProxyableListAssert<ELEMENT> isEqualTo(Object expected)
AbstractAssert
Example:
// assertions will pass
assertThat("abc").isEqualTo("abc");
assertThat(new HashMap<String, Integer>()).isEqualTo(new HashMap<String, Integer>());
// assertions will fail
assertThat("abc").isEqualTo("123");
assertThat(new ArrayList<String>()).isEqualTo(1);
isEqualTo
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isEqualTo
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
expected
- the given value to compare the actual value to.this
assertion object.public ProxyableListAssert<ELEMENT> isInstanceOf(Class<?> type)
AbstractAssert
Example:
// assertions will pass
assertThat("abc").isInstanceOf(String.class);
assertThat(new HashMap<String, Integer>()).isInstanceOf(HashMap.class);
assertThat(new HashMap<String, Integer>()).isInstanceOf(Map.class);
// assertions will fail
assertThat(1).isInstanceOf(String.class);
assertThat(new ArrayList<String>()).isInstanceOf(LinkedList.class);
isInstanceOf
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isInstanceOf
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
type
- the type to check the actual value against.public ProxyableListAssert<ELEMENT> isInstanceOfAny(Class<?>... types)
AbstractAssert
Example:
// assertions will pass
assertThat("abc").isInstanceOfAny(String.class, Integer.class);
assertThat(new ArrayList<String>()).isInstanceOfAny(LinkedList.class, ArrayList.class);
assertThat(new HashMap<String, Integer>()).isInstanceOfAny(TreeMap.class, Map.class);
// assertions will fail
assertThat(1).isInstanceOfAny(Double.class, Float.class);
assertThat(new ArrayList<String>()).isInstanceOfAny(LinkedList.class, Vector.class);
isInstanceOfAny
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isInstanceOfAny
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
types
- the types to check the actual value against.public ProxyableListAssert<ELEMENT> isOfAnyClassIn(Class<?>... types)
AbstractAssert
Example:
// assertions will pass
assertThat(new HashMap<String, Integer>()).isOfAnyClassIn(HashMap.class, TreeMap.class);
assertThat(new ArrayList<String>()).isOfAnyClassIn(ArrayList.class, LinkedList.class);
// assertions will fail
assertThat(new HashMap<String, Integer>()).isOfAnyClassIn(TreeMap.class, Map.class);
assertThat(new ArrayList<String>()).isOfAnyClassIn(LinkedList.class, List.class);
isOfAnyClassIn
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isOfAnyClassIn
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
types
- the types to check the actual value against.public ProxyableListAssert<ELEMENT> isExactlyInstanceOf(Class<?> type)
AbstractAssert
Example:
// assertions will pass
assertThat("abc").isExactlyInstanceOf(String.class);
assertThat(new ArrayList<String>()).isExactlyInstanceOf(ArrayList.class);
assertThat(new HashMap<String, Integer>()).isExactlyInstanceOf(HashMap.class);
// assertions will fail
assertThat(1).isExactlyInstanceOf(String.class);
assertThat(new ArrayList<String>()).isExactlyInstanceOf(List.class);
assertThat(new HashMap<String, Integer>()).isExactlyInstanceOf(Map.class);
isExactlyInstanceOf
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isExactlyInstanceOf
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
type
- the type to check the actual value against.public ProxyableListAssert<ELEMENT> isNotInstanceOf(Class<?> type)
AbstractAssert
Example:
// assertions will pass
assertThat(1).isNotInstanceOf(Double.class);
assertThat(new ArrayList<String>()).isNotInstanceOf(LinkedList.class);
// assertions will fail
assertThat("abc").isNotInstanceOf(String.class);
assertThat(new HashMap<String, Integer>()).isNotInstanceOf(HashMap.class);
assertThat(new HashMap<String, Integer>()).isNotInstanceOf(Map.class);
isNotInstanceOf
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isNotInstanceOf
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
type
- the type to check the actual value against.public ProxyableListAssert<ELEMENT> isNotInstanceOfAny(Class<?>... types)
AbstractAssert
Example:
// assertions will pass
assertThat(1).isNotInstanceOfAny(Double.class, Float.class);
assertThat(new ArrayList<String>()).isNotInstanceOfAny(LinkedList.class, Vector.class);
// assertions will fail
assertThat(1).isNotInstanceOfAny(Double.class, Integer.class);
assertThat(new ArrayList<String>()).isNotInstanceOfAny(LinkedList.class, ArrayList.class);
assertThat(new HashMap<String, Integer>()).isNotInstanceOfAny(TreeMap.class, Map.class);
isNotInstanceOfAny
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isNotInstanceOfAny
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
types
- the types to check the actual value against.public ProxyableListAssert<ELEMENT> isNotOfAnyClassIn(Class<?>... types)
AbstractAssert
Example:
// assertions will pass
assertThat(new HashMap<String, Integer>()).isNotOfAnyClassIn(Map.class, TreeMap.class);
assertThat(new ArrayList<String>()).isNotOfAnyClassIn(LinkedList.class, List.class);
// assertions will fail
assertThat(new HashMap<String, Integer>()).isNotOfAnyClassIn(HashMap.class, TreeMap.class);
assertThat(new ArrayList<String>()).isNotOfAnyClassIn(ArrayList.class, LinkedList.class);
isNotOfAnyClassIn
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isNotOfAnyClassIn
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
types
- the types to check the actual value against.public ProxyableListAssert<ELEMENT> isNotExactlyInstanceOf(Class<?> type)
AbstractAssert
Example:
// assertions will pass
assertThat(1).isNotExactlyInstanceOf(String.class);
assertThat(new ArrayList<String>()).isNotExactlyInstanceOf(List.class);
assertThat(new HashMap<String, Integer>()).isNotExactlyInstanceOf(Map.class);
// assertions will fail
assertThat("abc").isNotExactlyInstanceOf(String.class);
assertThat(new ArrayList<String>()).isNotExactlyInstanceOf(ArrayList.class);
assertThat(new HashMap<String, Integer>()).isNotExactlyInstanceOf(HashMap.class);
isNotExactlyInstanceOf
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isNotExactlyInstanceOf
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
type
- the type to check the actual value against.public ProxyableListAssert<ELEMENT> isSameAs(Object expected)
AbstractAssert
Example:
// Name is a class with first and last fields, two Names are equals if both first and last are equals.
Name tyrion = new Name("Tyrion", "Lannister");
Name alias = tyrion;
Name clone = new Name("Tyrion", "Lannister");
// assertions succeed:
assertThat(tyrion).isSameAs(alias)
.isEqualTo(clone);
// assertion fails:
assertThat(tyrion).isSameAs(clone);
isSameAs
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isSameAs
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
expected
- the given value to compare the actual value to.this
assertion object.public ProxyableListAssert<ELEMENT> isNotSameAs(Object expected)
AbstractAssert
Example:
// Name is a class with first and last fields, two Names are equals if both first and last are equals.
Name tyrion = new Name("Tyrion", "Lannister");
Name alias = tyrion;
Name clone = new Name("Tyrion", "Lannister");
// assertions succeed:
assertThat(clone).isNotSameAs(tyrion)
.isEqualTo(tyrion);
// assertion fails:
assertThat(alias).isNotSameAs(tyrion);
isNotSameAs
in interface Assert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>>
isNotSameAs
in class AbstractListAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
expected
- the given value to compare the actual value to.this
assertion object.public ProxyableListAssert<ELEMENT> startsWith(ELEMENT... sequence)
AbstractIterableAssert
ObjectEnumerableAssert.containsSequence(Object...)
, but it also verifies that the first element in the
sequence is also first element of the actual group.
Example:
// an Iterable is used in the example but it would also work with an array
Iterable<String> abc = newArrayList("a", "b", "c");
// assertions will pass
assertThat(abc).startsWith("a")
.startsWith("a", "b");
// assertion will fail
assertThat(abc).startsWith("c");
startsWith
in interface ObjectEnumerableAssert<ProxyableListAssert<ELEMENT>,ELEMENT>
startsWith
in class AbstractIterableAssert<ProxyableListAssert<ELEMENT>,List<? extends ELEMENT>,ELEMENT,ObjectAssert<ELEMENT>>
sequence
- the sequence of objects to look for.Copyright © 2014–2019 AssertJ. All rights reserved.