All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.skuzzle.test.snapshots.normalize.ObjectMembers Maven / Gradle / Ivy

There is a newer version: 1.11.0
Show newest version
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