Package org.mockito.internal.invocation
Class TypeSafeMatching
java.lang.Object
org.mockito.internal.invocation.TypeSafeMatching
- All Implemented Interfaces:
ArgumentMatcherAction
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(ArgumentMatcher matcher, Object argument) Implementations must apply the given matcher to the argument and returntrueif the operation was successful orfalseif not.private static Class<?>getArgumentType(ArgumentMatcher<?> argumentMatcher) Returns the type ofArgumentMatcher.matches(Object)of the givenArgumentMatcherimplementation.private static booleanisCompatible(ArgumentMatcher<?> argumentMatcher, Object argument) Returnstrueif the given argument can be passed to the givenargumentMatcherwithout causing aClassCastException.private static booleanisMatchesMethod(Method method) Returnstrueif the given method isArgumentMatcher.matches(Object)static ArgumentMatcherAction
-
Field Details
-
TYPE_SAFE_MATCHING_ACTION
-
-
Constructor Details
-
TypeSafeMatching
private TypeSafeMatching()
-
-
Method Details
-
matchesTypeSafe
-
apply
Description copied from interface:ArgumentMatcherActionImplementations must apply the given matcher to the argument and returntrueif the operation was successful orfalseif not. In this case no more matchers and arguments will be passed byMatcherApplicationStrategy.forEachMatcherAndArgument(ArgumentMatcherAction)to this method. .- Specified by:
applyin interfaceArgumentMatcherAction- Parameters:
matcher- to process the argument, nevernullargument- to be processed by the matcher, can benull- Returns:
trueif the matcher was successfully applied to the argument and the next pair of matcher and argument should be passedfalseotherwise
-
isCompatible
Returnstrueif the given argument can be passed to the givenargumentMatcherwithout causing aClassCastException. -
getArgumentType
Returns the type ofArgumentMatcher.matches(Object)of the givenArgumentMatcherimplementation. -
isMatchesMethod
Returnstrueif the given method isArgumentMatcher.matches(Object)
-