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

org.javers.core.metamodel.type.ValueObjectType Maven / Gradle / Ivy

There is a newer version: 7.6.1
Show newest version
package org.javers.core.metamodel.type;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

/**
 * ValueObject class in client's domain model.
 * 

* * Has list of mutable properties but no unique identifier. *

* * Two ValueObjects are compared property by property. *

* * Example: *
 *     class Address {
 *         private String city;
 *         private String street;
 *         private String zip;
 *         ...
 *     }
 * 
* * @author bartosz walacik */ public class ValueObjectType extends ManagedType{ private final boolean defaultType; ValueObjectType(ManagedClass valueObject){ super(valueObject); this.defaultType = false; } public ValueObjectType(Class baseJavaClass, List allProperties){ this(new ManagedClass(baseJavaClass, allProperties, Collections.emptyList())); } ValueObjectType(ManagedClass valueObject, Optional typeName, boolean isDefault) { super(valueObject, typeName); this.defaultType = isDefault; } @Override ValueObjectType spawn(ManagedClass managedClass, Optional typeName) { return new ValueObjectType(managedClass, typeName, defaultType); } @Override public boolean canBePrototype() { return !defaultType; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy