org.unitils.mock.argumentmatcher.impl
Class NullArgumentMatcher

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

public class NullArgumentMatcher
extends java.lang.Object
implements ArgumentMatcher

A matcher that will check whether an argument is null.

Author:
Kenny Claes, Filip Neven, Tim Ducheyne

Constructor Summary
NullArgumentMatcher()
           
 
Method Summary
 boolean matches(java.lang.Object argument, java.lang.Object argumentAtInvocationTime)
          Returns true if the given object is not null, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullArgumentMatcher

public NullArgumentMatcher()
Method Detail

matches

public boolean matches(java.lang.Object argument,
                       java.lang.Object argumentAtInvocationTime)
Returns true if the given object is not null, 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).

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:
True when passed object matches, false otherwise.


Copyright © 2009. All Rights Reserved.