org.unitils.mock.argumentmatcher
Interface ArgumentMatcher

All Known Implementing Classes:
AnyArgumentMatcher, DefaultArgumentMatcher, EqualsArgumentMatcher, LenEqArgumentMatcher, NotNullArgumentMatcher, NullArgumentMatcher, RefEqArgumentMatcher, SameArgumentMatcher

public interface ArgumentMatcher

A matcher that can check whether a given argument matches certain criteria.

Author:
Kenny Claes, Filip Neven, Tim Ducheyne

Method Summary
 boolean matches(java.lang.Object argument, java.lang.Object argumentAtInvocationTime)
          Returns true if the given object matches this object's expected argument, false otherwise.
 

Method Detail

matches

boolean matches(java.lang.Object argument,
                java.lang.Object argumentAtInvocationTime)
Returns true if the given object matches this object's expected argument, false otherwise. The argumentAtInvocationTime is a copy (deep clone) of the arguments at the time of the invocation. This way the original values can still be used later-on even when changes occur to the original values (pass-by-value vs pass-by-reference).

Parameters:
argument - The argument that was used by reference, not null
argumentAtInvocationTime - Copy of the argument, taken at the time that the invocation was performed, not null
Returns:
True when passed object matches, false otherwise.


Copyright © 2009. All Rights Reserved.