Package com.google.common.truth
Class LongSubject
- java.lang.Object
-
- com.google.common.truth.Subject
-
- com.google.common.truth.ComparableSubject<java.lang.Long>
-
- com.google.common.truth.LongSubject
-
public class LongSubject extends ComparableSubject<java.lang.Long>
Propositions forlong
subjects.- Author:
- David Saff, Christian Gruber (cgruber@israfil.net), Kurt Alfred Kluever
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.Factory<SubjectT extends Subject,ActualT>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LongSubject(FailureMetadata metadata, @Nullable java.lang.Long actual)
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
isAtLeast(int other)
Checks that the subject is greater than or equal toother
.void
isAtMost(int other)
Checks that the subject is less than or equal toother
.void
isEquivalentAccordingToCompareTo(@Nullable java.lang.Long other)
Deprecated.UseSubject.isEqualTo(java.lang.Object)
instead.void
isGreaterThan(int other)
Checks that the subject is greater thanother
.void
isLessThan(int other)
Checks that the subject is less thanother
.-
Methods inherited from class com.google.common.truth.ComparableSubject
isAtLeast, isAtMost, isGreaterThan, isIn, isLessThan, isNotIn
-
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
-
-
-
-
Constructor Detail
-
LongSubject
protected LongSubject(FailureMetadata metadata, @Nullable java.lang.Long actual)
Constructor for use by subclasses. If you want to create an instance of this class itself, callcheck(...)
.that(actual)
.
-
-
Method Detail
-
isEquivalentAccordingToCompareTo
@Deprecated public final void isEquivalentAccordingToCompareTo(@Nullable java.lang.Long other)
Deprecated.UseSubject.isEqualTo(java.lang.Object)
instead. Long comparison is consistent with equality.Description copied from class:ComparableSubject
Checks that the subject is equivalent toother
according toComparable.compareTo(T)
, (i.e., checks thata.comparesTo(b) == 0
).Note: Do not use this method for checking object equality. Instead, use
Subject.isEqualTo(Object)
.- Overrides:
isEquivalentAccordingToCompareTo
in classComparableSubject<java.lang.Long>
-
isGreaterThan
public final void isGreaterThan(int other)
Checks that the subject is greater thanother
.To check that the subject is greater than or equal to
other
, useisAtLeast(int)
.
-
isLessThan
public final void isLessThan(int other)
Checks that the subject is less thanother
.To check that the subject is less than or equal to
other
, useisAtMost(int)
.
-
isAtMost
public final void isAtMost(int other)
Checks that the subject is less than or equal toother
.To check that the subject is strictly less than
other
, useisLessThan(int)
.
-
isAtLeast
public final void isAtLeast(int other)
Checks that the subject is greater than or equal toother
.To check that the subject is strictly greater than
other
, useisGreaterThan(int)
.
-
-