View Javadoc

1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.matcher;
4   
5   /***
6    * Common utilities used by ArgMatcher implementations.
7    *
8    * @author Chad Woolley
9    * @version $Revision: 1.3 $
10   */
11  public class MatcherUtils {
12      /***
13       * Checks if both arguments are not null.
14       *
15       * @param objectOne first argument
16       * @param objectTwo second argument
17       *
18       * @return true if both arguments are not null
19       */
20      public boolean areBothNotNull(Object objectOne, Object objectTwo) {
21          if ((null != objectOne) && (null != objectTwo)) {
22              return true;
23          }
24  
25          return false;
26      }
27  
28      /***
29       * Checks if both arguments are null.
30       *
31       * @param objectOne first argument
32       * @param objectTwo second argument
33       *
34       * @return true if both arguments are null
35       */
36      public boolean areBothNull(Object objectOne, Object objectTwo) {
37          if ((null == objectOne) && (null == objectTwo)) {
38              return true;
39          }
40  
41          return false;
42      }
43  }