Class ListSubject<S extends ListSubject<S,T,C> , T, C extends List<T>>
java.lang.Object
com.google.common.truth.Subject<S,C>
com.google.common.truth.IterableSubject<S,T,C>
com.google.common.truth.CollectionSubject<S,T,C>
com.google.common.truth.ListSubject<S,T,C>
public class ListSubject<S extends ListSubject<S,T,C>, T, C extends List<T>>
extends CollectionSubject<S,T,C>
Propositions for
List subjects.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class CollectionSubject
CollectionSubject.Has<T,C> Nested classes/interfaces inherited from class Subject
Subject.HasField -
Field Summary
Fields inherited from class Subject
failureStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontainsSequence(List<?> sequence) Fails if the list does not contain the specified sequence.(package private) static <T, C extends List<T>>
ListSubject<? extends ListSubject<?, T, C>, T, C> create(FailureStrategy failureStrategy, List<T> list) voidFails if the list is not strictly ordered according to the natural ordering of its elements.voidisOrdered(Comparator<T> comparator) Fails if the list is not strictly ordered according to the given comparator.voidFails if the list is not partially ordered according to the natural ordering of its elements.voidisPartiallyOrdered(Comparator<T> comparator) Fails if the list is not partially ordered according to the given comparator.private voidpairwiseCheck(ListSubject.PairwiseChecker<T> checker) Methods inherited from class CollectionSubject
create, hasMethods inherited from class IterableSubject
contains, containsAllIn, containsAllOf, containsAnyIn, containsAnyOf, containsExactly, containsExactlyElementsIn, containsNoDuplicates, containsNoneIn, containsNoneOf, containsOnlyElements, containsOnlyElementsIn, create, doesNotContain, hasSize, isEmpty, isNotEmpty, iteratesAs, iteratesAs, iteratesOverSequenceMethods inherited from class Subject
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hasField, hashCode, internalCustomName, is, isA, isEqualTo, isInstanceOf, isNotA, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, labeled, named
-
Constructor Details
-
ListSubject
ListSubject(FailureStrategy failureStrategy, C list)
-
-
Method Details
-
create
static <T, C extends List<T>> ListSubject<? extends ListSubject<?,T, createC>, T, C> (FailureStrategy failureStrategy, List<T> list) -
containsSequence
Fails if the list does not contain the specified sequence. -
isOrdered
public void isOrdered()Fails if the list is not strictly ordered according to the natural ordering of its elements. Null elements are not permitted.- Throws:
ClassCastException- if any pair of elements is not mutually Comparable.NullPointerException- if any element is null.
-
isPartiallyOrdered
public void isPartiallyOrdered()Fails if the list is not partially ordered according to the natural ordering of its elements. Null elements are not permitted.- Throws:
ClassCastException- if any pair of elements is not mutually Comparable.NullPointerException- if any element is null.
-
isOrdered
Fails if the list is not strictly ordered according to the given comparator. Null elements are not permitted.- Throws:
ClassCastException- if any pair of elements is not mutually Comparable.NullPointerException- if any element is null.
-
isPartiallyOrdered
Fails if the list is not partially ordered according to the given comparator. Null elements are not permitted.- Throws:
ClassCastException- if any pair of elements is not mutually Comparable.NullPointerException- if any element is null.
-
pairwiseCheck
-