org.junit.contrib.truth.subjects
Class ListSubject<S extends ListSubject<S,T,C>,T,C extends List<T>>

java.lang.Object
  extended by org.junit.contrib.truth.subjects.Subject<S,C>
      extended by org.junit.contrib.truth.subjects.IterableSubject<S,T,C>
          extended by org.junit.contrib.truth.subjects.CollectionSubject<S,T,C>
              extended by org.junit.contrib.truth.subjects.ListSubject<S,T,C>

@GwtCompatible
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 org.junit.contrib.truth.subjects.Subject
Subject.And<C>
 
Constructor Summary
protected ListSubject(FailureStrategy failureStrategy, C list)
           
 
Method Summary
 Subject.And<S> 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)
           
 Subject.And<S> isOrdered()
          Attests that a List is strictly ordered according to the natural ordering of its elements.
 Subject.And<S> isOrdered(Comparator<T> comparator)
          Attests that a List is strictly ordered according to the given comparator.
 Subject.And<S> isPartiallyOrdered()
          Attests that a List is partially ordered according to the natural ordering of its elements.
 Subject.And<S> isPartiallyOrdered(Comparator<T> comparator)
          Attests that a List is partially ordered according to the given comparator.
 
Methods inherited from class org.junit.contrib.truth.subjects.CollectionSubject
contains, containsAllOf, containsAnyOf, create, isEmpty
 
Methods inherited from class org.junit.contrib.truth.subjects.IterableSubject
create, hasContentsAnyOrder, hasContentsInOrder
 
Methods inherited from class org.junit.contrib.truth.subjects.Subject
check, fail, failWithoutSubject, getSubject, is, isA, isEqualTo, isNotA, isNotEqualTo, isNotNull, isNull, nextChain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, 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 Subject.And<S> containsSequence(List<?> sequence)
Attests that a List contains the specified sequence.


isOrdered

public Subject.And<S> 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 Subject.And<S> 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 Subject.And<S> 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 Subject.And<S> 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.