Class EntityInstantiators
java.lang.Object
org.springframework.data.mapping.model.EntityInstantiators
Simple value object allowing access to
EntityInstantiator
instances for a given type falling back to a
default one.- Since:
- 2.3
- Author:
- Oliver Drotbohm, Thomas Darimont, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorDescriptionCreates a newEntityInstantiators
using the default fallback instantiator and no custom ones.EntityInstantiators
(Map<Class<?>, EntityInstantiator> customInstantiators) Creates a newEntityInstantiators
using the default fallback instantiator and the given custom ones.EntityInstantiators
(EntityInstantiator fallback) Creates a newEntityInstantiators
using the givenEntityInstantiator
as fallback.EntityInstantiators
(EntityInstantiator defaultInstantiator, Map<Class<?>, EntityInstantiator> customInstantiators) Creates a newEntityInstantiator
using the given fallbackEntityInstantiator
and the given custom ones. -
Method Summary
Modifier and TypeMethodDescriptiongetInstantiatorFor
(PersistentEntity<?, ?> entity) Returns theEntityInstantiator
to be used to create the givenPersistentEntity
.
-
Constructor Details
-
EntityInstantiators
public EntityInstantiators()Creates a newEntityInstantiators
using the default fallback instantiator and no custom ones. -
EntityInstantiators
Creates a newEntityInstantiators
using the givenEntityInstantiator
as fallback.- Parameters:
fallback
- must not be null.
-
EntityInstantiators
Creates a newEntityInstantiators
using the default fallback instantiator and the given custom ones.- Parameters:
customInstantiators
- must not be null.
-
EntityInstantiators
public EntityInstantiators(EntityInstantiator defaultInstantiator, Map<Class<?>, EntityInstantiator> customInstantiators) Creates a newEntityInstantiator
using the given fallbackEntityInstantiator
and the given custom ones.- Parameters:
defaultInstantiator
- must not be null.customInstantiators
- must not be null.
-
-
Method Details
-
getInstantiatorFor
Returns theEntityInstantiator
to be used to create the givenPersistentEntity
.- Parameters:
entity
- must not be null.- Returns:
- will never be null.
-