Package com.google.common.truth
Class OptionalSubject<T>
- java.lang.Object
-
- com.google.common.truth.Subject<OptionalSubject<T>,com.google.common.base.Optional<T>>
-
- com.google.common.truth.OptionalSubject<T>
-
public class OptionalSubject<T> extends Subject<OptionalSubject<T>,com.google.common.base.Optional<T>>
Propositions forOptional
<T>
subjects.- Author:
- Christian Gruber (cgruber@israfil.net)
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
hasValue(Object expected)
Fails if theOptional
<T>
does not have the given value.void
isAbsent()
Fails if theOptional
<T>
is present.void
isPresent()
Fails if theOptional
<T>
is absent.-
Methods inherited from class com.google.common.truth.Subject
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hasField, hashCode, internalCustomName, is, isA, isEqualTo, isInstanceOf, isNotA, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, labeled, named
-
-
-
-
Method Detail
-
isPresent
public void isPresent()
Fails if theOptional
<T>
is absent.
-
isAbsent
public void isAbsent()
Fails if theOptional
<T>
is present.
-
hasValue
public void hasValue(Object expected)
Fails if theOptional
<T>
does not have the given value.
-
-