Class ComparableSubject<S extends Subject<S,T> , T extends Comparable>
java.lang.Object
com.google.common.truth.Subject<S,T>
com.google.common.truth.ComparableSubject<S,T>
- Direct Known Subclasses:
BooleanSubject, IntegerSubject, LongSubject, StringSubject
public abstract class ComparableSubject<S extends Subject<S,T>, T extends Comparable>
extends Subject<S,T>
Propositions for
Comparable typed subjects.-
Nested Class Summary
Nested classes/interfaces inherited from class Subject
Subject.HasField -
Field Summary
Fields inherited from class Subject
failureStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcomparesEqualTo(T other) Fails if the subject is not equivalent to the given value according toComparable.compareTo(T).final voidFails if the subject is less than the given value.final voidFails if the subject is greater than the given value.final voidisGreaterThan(T other) Fails if the subject is not greater than the given value.final voidFails if the subject is not in the given range.final voidisLessThan(T other) Fails if the subject is not less than the given value.final voidFails if the subject is in the given range.Methods inherited from class 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
-
Constructor Details
-
ComparableSubject
ComparableSubject(FailureStrategy failureStrategy, T subject)
-
-
Method Details
-
isIn
Fails if the subject is not in the given range. -
isNotIn
Fails if the subject is in the given range. -
comparesEqualTo
Fails if the subject is not equivalent to the given value according toComparable.compareTo(T). -
isGreaterThan
Fails if the subject is not greater than the given value. -
isLessThan
Fails if the subject is not less than the given value. -
isAtMost
Fails if the subject is greater than the given value. -
isAtLeast
Fails if the subject is less than the given value.
-