org.unitils.mock.argumentmatcher.impl
Class AnyArgumentMatcher

java.lang.Object
  extended by org.unitils.mock.argumentmatcher.impl.AnyArgumentMatcher
All Implemented Interfaces:
ArgumentMatcher

public class AnyArgumentMatcher
extends Object
implements ArgumentMatcher

A matcher for checking whether an argument value is of a certain type.

Author:
Tim Ducheyne, Filip Neven

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.unitils.mock.argumentmatcher.ArgumentMatcher
ArgumentMatcher.MatchResult
 
Constructor Summary
AnyArgumentMatcher(Class<?> type)
          Creates a matcher for the given expected type.
 
Method Summary
 ArgumentMatcher.MatchResult matches(Object argument, Object argumentAtInvocationTime)
          Returns true if the given argument is of the expected type, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnyArgumentMatcher

public AnyArgumentMatcher(Class<?> type)
Creates a matcher for the given expected type.

Parameters:
type - The expected type, not null
Method Detail

matches

public ArgumentMatcher.MatchResult matches(Object argument,
                                           Object argumentAtInvocationTime)
Returns true if the given argument is of the expected type, false otherwise.

Specified by:
matches in interface ArgumentMatcher
Parameters:
argument - The argument that were used by reference, not null
argumentAtInvocationTime - Copy of the argument, taken at the time that the invocation was performed, not null
Returns:
The match result, not null


Copyright © 2011. All Rights Reserved.