Package com.google.common.truth
Class OptionalIntSubject
- java.lang.Object
-
- com.google.common.truth.Subject
-
- com.google.common.truth.OptionalIntSubject
-
public final class OptionalIntSubject extends Subject
Propositions for Java 8OptionalIntsubjects.- Author:
- Ben Douglass
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.Factory<SubjectT extends Subject,ActualT>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhasValue(int expected)Fails if theOptionalIntdoes not have the given value or the subject is null.voidisEmpty()Fails if theOptionalIntis present or the subject is null.voidisPresent()Fails if theOptionalIntis empty or the subject is null.static Subject.Factory<OptionalIntSubject,OptionalInt>optionalInts()-
Methods inherited from class com.google.common.truth.Subject
actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString
-
-
-
-
Method Detail
-
isPresent
public void isPresent()
Fails if theOptionalIntis empty or the subject is null.
-
isEmpty
public void isEmpty()
Fails if theOptionalIntis present or the subject is null.
-
hasValue
public void hasValue(int expected)
Fails if theOptionalIntdoes not have the given value or the subject is null. More sophisticated comparisons can be done usingassertThat(optional.getAsInt())….
-
optionalInts
public static Subject.Factory<OptionalIntSubject,OptionalInt> optionalInts()
-
-