com.google.common.truth
Class ListSubject<S extends ListSubject<S,T,C>,T,C extends List<T>>

java.lang.Object
  extended by com.google.common.truth.Subject<S,C>
      extended by com.google.common.truth.IterableSubject<S,T,C>
          extended by com.google.common.truth.CollectionSubject<S,T,C>
              extended by 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>


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.common.truth.CollectionSubject
CollectionSubject.Has<E,C extends Collection<E>>
 
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.HasField
 
Field Summary
 
Fields inherited from class com.google.common.truth.Subject
failureStrategy
 
Constructor Summary
protected ListSubject(FailureStrategy failureStrategy, C list)
           
 
Method Summary
 void containsSequence(List<?> sequence)
          Attests that a List contains the specified sequence.
static
<T,C extends List<T>>
ListSubject<? extends ListSubject<?,T,C>,T,C>
create(FailureStrategy failureStrategy, List<T> list)
           
 void isOrdered()
          Attests that a List is strictly ordered according to the natural ordering of its elements.
 void isOrdered(Comparator<T> comparator)
          Attests that a List is strictly ordered according to the given comparator.
 void isPartiallyOrdered()
          Attests that a List is partially ordered according to the natural ordering of its elements.
 void isPartiallyOrdered(Comparator<T> comparator)
          Attests that a List is partially ordered according to the given comparator.
 
Methods inherited from class com.google.common.truth.CollectionSubject
create, has, isEmpty
 
Methods inherited from class com.google.common.truth.IterableSubject
create, isNotEmpty, iteratesAs, iteratesAs, iteratesOverSequence
 
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hasField, hashCode, internalCustomName, is, isA, isEqualTo, isNotA, isNotEqualTo, isNotNull, isNull, labeled, named
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSubject

protected ListSubject(FailureStrategy failureStrategy,
                      C list)
Method Detail

create

public static <T,C extends List<T>> ListSubject<? extends ListSubject<?,T,C>,T,C> create(FailureStrategy failureStrategy,
                                                                                         List<T> list)

containsSequence

public void containsSequence(List<?> sequence)
Attests that a List contains the specified sequence.


isOrdered

public void isOrdered()
Attests that a List is 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()
Attests that a List is 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

public void isOrdered(Comparator<T> comparator)
Attests that a List is 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

public void isPartiallyOrdered(Comparator<T> comparator)
Attests that a List is 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.


Copyright © 2014. All rights reserved.