com.google.common.truth
Class OptionalSubject<T>

java.lang.Object
  extended by com.google.common.truth.Subject<OptionalSubject<T>,com.google.common.base.Optional<T>>
      extended by com.google.common.truth.OptionalSubject<T>

public class OptionalSubject<T>
extends Subject<OptionalSubject<T>,com.google.common.base.Optional<T>>

Propositions for Optional<T> subjects

Author:
Christian Gruber ([email protected])

Nested Class Summary
 
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
OptionalSubject(FailureStrategy failureStrategy, com.google.common.base.Optional<T> subject)
           
 
Method Summary
 void hasValue(Object expected)
          Attests that the Optional<T> subject is present and has the supplied value.
 void isAbsent()
          Attests that the Optional<T> subject is absent.
 void isPresent()
          Attests that the Optional<T> subject has a present value.
 
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

OptionalSubject

public OptionalSubject(FailureStrategy failureStrategy,
                       com.google.common.base.Optional<T> subject)
Method Detail

isPresent

public void isPresent()
Attests that the Optional<T> subject has a present value.


isAbsent

public void isAbsent()
Attests that the Optional<T> subject is absent.


hasValue

public void hasValue(Object expected)
Attests that the Optional<T> subject is present and has the supplied value.



Copyright © 2014. All rights reserved.