de.skuzzle.test.snapshots.normalize.ObjectMembers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snapshot-tests-normalize Show documentation
Show all versions of snapshot-tests-normalize Show documentation
Travers/Clean/Normalize object instances
package de.skuzzle.test.snapshots.normalize;
import java.lang.reflect.Method;
import java.util.function.Function;
import java.util.stream.Stream;
import de.skuzzle.test.snapshots.normalize.MethodObjectMembers.PropertyConventions;
/**
* Defines how direct members of an actual object instance are discovered. Use any of the
* static factories in this interface to obtain an instance.
*
* @author Simon Taddiken
* @see ObjectTraversal
* @apiNote This interface is meant for internal implementations only.
*/
public interface ObjectMembers {
static ObjectMembers fieldBased() {
return FieldObjectMembers.getInstance();
}
static ObjectMembers usingJavaBeansConventions() {
return MethodObjectMembers.usingJavaBeansConventions();
}
static ObjectMembers using(Function conventions) {
return MethodObjectMembers.using(conventions);
}
/**
* Internal API method that is used to determine the direct members of the given root
* object without recursing into children.
*
* @param root The root object to inspect.
* @param collectionParent If the root object was discovered within a collection, this
* is a reference to the collection.
* @param visitorContext Context information for the current traversal.
* @return Stream of direct children.
*/
Stream directMembersOf(Object root, Object collectionParent, VisitorContext visitorContext);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy