Interface EntityOps
- All Known Implementing Classes:
EntityModel
public interface EntityOps
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic Objectstatic ObjectdeepCopy(Object entity, Function<Class<?>, EntityOps> classToOps, Function<Object, Object> getEntityToClone, BiConsumer<Object, Object> putEntityToClone) static ObjectdeepCopy(Object entity, Function<Class<?>, EntityOps> classToOps, Function<Object, Object> getEntityToClone, BiConsumer<Object, Object> putEntityToClone, Predicate<Object> getIsCopied, Consumer<Object> setIsCopied) static ObjectDeep copy, with any entity in managedEntities does NOT cause the creation of a clone For all entities not in the set a clone will be created and added to the set<A> AfindAnnotation(Class<A> annotationClass) Class<?> default Collection<? extends PropertyOps> Convenience method for getting read- and writable propertiesIterator<?> <T> TOperations may be associated with an entity.Collection<? extends PropertyOps> getProperty(String name) booleanbooleanEntities may be container for items One issue is the identity of the items: E.g.booleanbooleanvoid
-
Method Details
-
getAssociatedClass
Class<?> getAssociatedClass() -
getOps
Operations may be associated with an entity. For example, an entity may support map operations (put, get, etc...) While such an entity may e.g. have a (read-only) size property, the get / put operations would be part of separate operations class associate with this entityOps instance. -
findAnnotation
-
isInstantiable
boolean isInstantiable() -
newInstance
Object newInstance() -
getProperties
Collection<? extends PropertyOps> getProperties() -
isClonable
boolean isClonable() -
clone
-
isPrimitive
boolean isPrimitive() -
getEditableProperties
Convenience method for getting read- and writable properties- Returns:
-
getProperty
-
getPropertyNames
-
deepCopy
-
isCollection
boolean isCollection()Entities may be container for items One issue is the identity of the items: E.g. a map is a collection of entry objects, but the getEntries method may create a copy of the entry objects. So if we cloned a collection, we would also have to clone the entry objects - even thought they are only temporary. -
getItems
-
setItems
-
deepCopy
static Object deepCopy(Object entity, Function<Class<?>, EntityOps> classToOps, Set<Object> managedEntities) Deep copy, with any entity in managedEntities does NOT cause the creation of a clone For all entities not in the set a clone will be created and added to the set- Parameters:
entity-classToOps-managedEntities-- Returns:
-
deepCopy
-
deepCopy
-
copy
-