org.junit.contrib.truth.subjects
Class CollectionSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<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>
Direct Known Subclasses:
ListSubject

@GwtCompatible
public class CollectionSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>
extends IterableSubject<S,T,C>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.junit.contrib.truth.subjects.Subject
Subject.And<C>
 
Constructor Summary
protected CollectionSubject(FailureStrategy failureStrategy, C list)
           
 
Method Summary
 Subject.And<S> contains(Object item)
          Attests that a Collection contains the provided object or fails.
 Subject.And<S> containsAllOf(Object... items)
          Attests that a Collection contains all of the provided objects or fails.
 Subject.And<S> containsAnyOf(Object... items)
          Attests that a Collection contains at least one of the provided objects or fails.
static
<T,C extends Collection<T>>
CollectionSubject<? extends CollectionSubject<?,T,C>,T,C>
create(FailureStrategy failureStrategy, Collection<T> list)
           
 Subject.And<S> isEmpty()
          Attests that a Collection contains the provided object or fails.
 
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

CollectionSubject

protected CollectionSubject(FailureStrategy failureStrategy,
                            C list)
Method Detail

create

public static <T,C extends Collection<T>> CollectionSubject<? extends CollectionSubject<?,T,C>,T,C> create(FailureStrategy failureStrategy,
                                                                                                           Collection<T> list)

contains

public Subject.And<S> contains(Object item)
Attests that a Collection contains the provided object or fails.

Overrides:
contains in class IterableSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>

isEmpty

public Subject.And<S> isEmpty()
Description copied from class: IterableSubject
Attests that a Collection contains the provided object or fails.

Overrides:
isEmpty in class IterableSubject<S extends CollectionSubject<S,T,C>,T,C extends Collection<T>>

containsAnyOf

public Subject.And<S> containsAnyOf(Object... items)
Attests that a Collection contains at least one of the provided objects or fails.


containsAllOf

public Subject.And<S> containsAllOf(Object... items)
Attests that a Collection contains all of the provided objects or fails. This copes with duplicates in both the Collection and the parameters.



Copyright © 2014. All Rights Reserved.