org.javers.core.graph.ObjectNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javers-core Show documentation
Show all versions of javers-core Show documentation
JaVers - object auditing and diff framework for Java
package org.javers.core.graph;
import java.util.Optional;
import org.javers.common.validation.Validate;
import org.javers.core.metamodel.object.Cdo;
import org.javers.core.metamodel.object.CdoSnapshot;
import org.javers.core.metamodel.object.GlobalId;
import org.javers.core.metamodel.property.Property;
import org.javers.core.metamodel.type.EntityType;
import org.javers.core.metamodel.type.JaversProperty;
import org.javers.core.metamodel.type.ManagedType;
import org.javers.core.metamodel.type.ValueObjectType;
import java.util.HashMap;
import java.util.Map;
import static org.javers.common.validation.Validate.argumentsAreNotNull;
/**
* Node in client's domain object graph. Reflects one {@link Cdo} or {@link CdoSnapshot}.
*
* Cdo could be an {@link EntityType} or a {@link ValueObjectType}
*
* Implementation should delegate equals() and hashCode() to {@link Cdo}
*
* @author bartosz walacik
*/
public class ObjectNode {
private final Cdo cdo;
private final Map edges = new HashMap<>();
public ObjectNode(Cdo cdo) {
argumentsAreNotNull(cdo);
this.cdo = cdo;
}
/**
* @return returns {@link Optional#EMPTY} for snapshots
*/
public Optional