org.srplib.reflection.deepcompare.DeepComparatorContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of srp-reflection-support Show documentation
Show all versions of srp-reflection-support Show documentation
Single Responsibility Principle (SRP) libraries collection
package org.srplib.reflection.deepcompare;
/**
* Deep comparator context.
*
*
* - Provides access to root comparator object for DeepComparator implementations.
* - Provides methods to register mismatches.
*
* Used to
*
* @author Anton Pechinsky
*/
public interface DeepComparatorContext {
/**
* Compare objects using common comparison infrastructure.
*
* @param object1 first object
* @param object2 second object
*/
void compare(Object object1, Object object2);
/**
* Compare objects with object graph path information.
*
* @param object1 first object
* @param object2 second object
* @param node String new object graph path segment. This may be field name, collection index, etc. Used to build
* mismatch path from root node to current node.
*/
void compareNested(Object object1, Object object2, String node);
/**
* Registers mismatch information.
*
* Implementation is responsible
*
* @param pattern String mismatch message pattern.
* @param arguments String mismatch message arguments.
*/
void registerMismatch(String pattern, Object... arguments);
}