de.skuzzle.test.snapshots.normalize.ObjectMember 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.util.Collection;
import java.util.Optional;
/**
* A pointer to a class member belonging to a certain object instance. Allows to read and
* modify the member's value in place.
*
* @author Simon Taddiken
* @see ObjectTraversal
*/
public interface ObjectMember {
/**
* The object of which this is a direct child attribute.
*
* @return Our parent.
*/
Object parent();
/**
* If {@link #parent()} has been discovered in a supported collection type (array,
* {@link Iterable}, {@link Collection}) this method returns the respective
* collection.
*
* Note that, during traversal, only the first occurrence of an object instance is
* taken into account. If the same object is once referenced in a collection
* and once directly, then depending on attribute discovery order, you might
* or might not encounter the one with available collection parent.
*
* @return Pointer to the collection in which {@link #parent()} has been discovered
* while traversing an object graph.
*/
Optional
© 2015 - 2025 Weber Informatics LLC | Privacy Policy