org.truth0.subjects
Class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>>

java.lang.Object
  extended by org.truth0.subjects.Subject<S,M>
      extended by org.truth0.subjects.MapSubject<S,K,V,M>

@GwtCompatible
public class MapSubject<S extends MapSubject<S,K,V,M>,K,V,M extends Map<K,V>>
extends Subject<S,M>

Author:
Christian Gruber (cgruber@israfil.net)

Nested Class Summary
static interface MapSubject.WithValue<V>
           
 
Field Summary
 
Fields inherited from class org.truth0.subjects.Subject
failureStrategy
 
Constructor Summary
MapSubject(FailureStrategy failureStrategy, M map)
           
 
Method Summary
static
<K,V,M extends Map<K,V>>
MapSubject<? extends MapSubject<?,K,V,M>,K,V,M>
create(FailureStrategy failureStrategy, Map<K,V> map)
           
 MapSubject.WithValue<V> hasKey(K key)
          Attests that the subject contains the provided key or fails.
 void hasValue(V key)
           
 void isEmpty()
          Attests that the subject holds no objects, or fails.
 void isNotEmpty()
          Attests that the subject holds one or more objects, or fails
 void lacksKey(K key)
           
 void lacksValue(V key)
           
 
Methods inherited from class org.truth0.subjects.Subject
check, equals, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hashCode, internalCustomLabel, is, isEqualTo, isNotEqualTo, isNotNull, isNull, labeled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapSubject

public MapSubject(FailureStrategy failureStrategy,
                  M map)
Method Detail

isEmpty

public void isEmpty()
Attests that the subject holds no objects, or fails.


isNotEmpty

public void isNotEmpty()
Attests that the subject holds one or more objects, or fails


hasKey

public MapSubject.WithValue<V> hasKey(K key)
Attests that the subject contains the provided key or fails.


lacksKey

public void lacksKey(K key)

hasValue

public void hasValue(V key)

lacksValue

public void lacksValue(V key)

create

public static <K,V,M extends Map<K,V>> MapSubject<? extends MapSubject<?,K,V,M>,K,V,M> create(FailureStrategy failureStrategy,
                                                                                              Map<K,V> map)


Copyright © 2014. All rights reserved.