• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2007 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 
6 package org.mockito.internal.matchers.apachecommons;
7 
8 import java.io.Serializable;
9 
10 import org.hamcrest.Description;
11 import org.mockito.ArgumentMatcher;
12 
13 public class ReflectionEquals extends ArgumentMatcher<Object> implements Serializable {
14     private static final long serialVersionUID = 2022780425116330014L;
15     private final Object wanted;
16     private final String[] excludeFields;
17 
ReflectionEquals(Object wanted, String... excludeFields)18     public ReflectionEquals(Object wanted, String... excludeFields) {
19         this.wanted = wanted;
20         this.excludeFields = excludeFields;
21     }
22 
matches(Object actual)23     public boolean matches(Object actual) {
24         return EqualsBuilder.reflectionEquals(wanted, actual, excludeFields);
25     }
26 
describeTo(Description description)27     public void describeTo(Description description) {
28         description.appendText("refEq(" + wanted + ")");
29     }
30 }