Package org.modelmapper.spring.data
Interface AggregateIdentifierProcessor
- All Superinterfaces:
org.springframework.plugin.core.Plugin<Class<?>>
- All Known Implementing Classes:
UriTemplateIdentifierProcessor
public interface AggregateIdentifierProcessor
extends org.springframework.plugin.core.Plugin<Class<?>>
SPI interface to customize identifier to aggregate mapping in
RepositoryMappingModule.
AggregareIdentifierProcessor implementations can be registered with it to pre- and post process the source and target
identifier values obtained from source and target objects.- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and TypeMethodDescriptiondefault Collection<Class<?>>Returns additional identifier types that the processor will be able to handle.default ObjectpostProcessIdentifier(Object identifier, Class<?> sourceType, Class<?> targetType) Post process the identifier obtained from the aggregate to finally constitute the value to be set on the target object.default ObjectpreProcessIdentifier(Object identifier, Class<?> targetType) Pre-process the identifier obtained from the source object to finally resolve an aggregate from the returned value.Methods inherited from interface org.springframework.plugin.core.Plugin
supports
-
Method Details
-
preProcessIdentifier
Pre-process the identifier obtained from the source object to finally resolve an aggregate from the returned value.- Parameters:
identifier- the original identifier obtained from the source object. Must not be null.targetType- the target aggregate type the given identifier is supposed to eventually identify. Must not be null.- Returns:
- will never be null.
-
postProcessIdentifier
Post process the identifier obtained from the aggregate to finally constitute the value to be set on the target object.- Parameters:
identifier- the original identifier of the aggregate to be transformed into the target object's property value. Must not be null.sourceType- the source aggregate type. Must not be null.targetType- the target type to create for this aggregate. Can be used to decide whether to actually apply post-processing.- Returns:
- will never be null.
-
getAdditionalIdentifierTypes
Returns additional identifier types that the processor will be able to handle.- Returns:
- will never be null.
-