Package org.immutables.check
Class ObjectChecker<T>
java.lang.Object
org.immutables.check.ObjectChecker<T>
- Type Parameters:
T- the generic type
- Direct Known Subclasses:
IterableChecker,StringChecker
The match wrapper.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidEvaluates to true only if ALL of the passed in matchers evaluate to true.final voidEvaluates to true if ANY of the passed in matchers evaluate to true.voidanything()This matcher always evaluates to true.asString()protected voidbooleanDeprecated.(package private) static voidinthashCode()Deprecated.This class should not be used with collectionsvoidhasToString(String expectedToStringValue) voidvoidThis is equal to checkvoidIs the value an instance of a particular type?.voidisIn(Collection<T> values) final voidvoidisNull()not()Makes checker negative.voidInverts the rule.voidvoidnotNull()voidCreates a new instance of IsSamevoid(package private) static StackTraceElement[]trimStackTrace(StackTraceElement[] stackTrace) (package private) static voidverifyCheck(String description, boolean assertionState) protected voidverifyUsingMatcher(org.hamcrest.Matcher<? super T> matcher) (package private) static <Z> voidverifyUsingMatcher(Z actualValue, org.hamcrest.Matcher<? super Z> matcher)
-
Field Details
-
actualValue
-
negate
final boolean negate
-
-
Constructor Details
-
ObjectChecker
-
-
Method Details
-
fail
-
trimStackTrace
-
verifyCheck
-
verifyUsingMatcher
static <Z> void verifyUsingMatcher(@Nullable Z actualValue, org.hamcrest.Matcher<? super Z> matcher) -
equals
Deprecated.You probably want to useis(Object)method for matcher wrapper.Deprecated to prevent accidental usage of this method. -
allOf
Evaluates to true only if ALL of the passed in matchers evaluate to true.- Parameters:
matchers- the matchers
-
anyOf
Evaluates to true if ANY of the passed in matchers evaluate to true.- Parameters:
matchers- the matchers
-
anything
public void anything()This matcher always evaluates to true. -
asString
-
hasToString
-
is
-
is
This is equal to check- Parameters:
value- the value
-
isA
Is the value an instance of a particular type?.- Parameters:
type- the type
-
isNull
public void isNull() -
not
Inverts the rule.- Parameters:
matcher- the matcher
-
not
Makes checker negative.- Returns:
- negative checker
-
ensureNonNegative
protected void ensureNonNegative() -
not
-
notNull
public void notNull() -
same
Creates a new instance of IsSame- Parameters:
object- The predicate evaluates to true only when the argument is this object.
-
isIn
-
isIn
-
satisfies
-
verifyUsingMatcher
-
hashCode
Deprecated.This class should not be used with collections
-
is(Object)method for matcher wrapper.