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 org.mockito.ArgumentMatcher; 9 10 import java.io.Serializable; 11 12 public class ReflectionEquals implements ArgumentMatcher<Object>, Serializable { 13 14 private final Object wanted; 15 private final String[] excludeFields; 16 17 public ReflectionEquals(Object wanted, String... excludeFields) { 18 this.wanted = wanted; 19 this.excludeFields = excludeFields; 20 } 21 22 public boolean matches(Object actual) { 23 return EqualsBuilder.reflectionEquals(wanted, actual, excludeFields); 24 } 25 26 public String toString() { 27 return "refEq(" + wanted + ")"; 28 } 29 } 30