public interface ModelMapperMappable
Provides a mapping definition between a business domain instance and a repository domain
instance. Repository domain classes usually implement this interface in order to inform a
DomainMapperMember
. The mapping described is facilitated with the ModelMapper
library.
Hierarchies within an item marked as ModelMapperMappable
should almost always inherit
their parent mapping using TypeMap.includeBase(Class, Class)
. Example:
public class JpaCustomer implements ModelMapperMappable { @NonNull public ModelMapper fromMe() { ModelMapper mapper } }
Modifier and Type | Method and Description |
---|---|
org.modelmapper.ModelMapper |
fromMe()
Return a mapper instance capable of transferring information from this domain type to a
business domain type.
|
default void |
postFromMe(ContextInfo contextInfo,
Object businessDomain)
Lifecycle method that is executed after mapping occurs from a repository entity to a business
domain.
|
default void |
postToMe(ContextInfo contextInfo,
Object businessDomain)
Lifecycle method that is executed after mapping occurs from a business domain to a repository
entity.
|
default void |
preFromMe(ContextInfo contextInfo,
Object businessDomain)
This is a lifecycle method and allows for any logic to be executed prior to the mapping
occuring.
|
default void |
preToMe(ContextInfo contextInfo,
Object businessDomain)
This is a lifecycle method and allows for any logic to be executed prior to the mapping
occuring.
|
org.modelmapper.ModelMapper |
toMe()
Return a mapper instance capable of transferring information from a business domain type to
this domain type.
|
@NonNull org.modelmapper.ModelMapper fromMe()
@NonNull org.modelmapper.ModelMapper toMe()
default void preFromMe(@Nullable ContextInfo contextInfo, @NonNull Object businessDomain)
ThreadLocal
instances as needed, or manually map specific values.contextInfo
- businessDomain
- default void preToMe(@Nullable ContextInfo contextInfo, @NonNull Object businessDomain)
ThreadLocal
instances as needed, or manually map specific values.contextInfo
- businessDomain
- default void postFromMe(@Nullable ContextInfo contextInfo, @NonNull Object businessDomain)
contextInfo
- businessDomain
- default void postToMe(@Nullable ContextInfo contextInfo, @NonNull Object businessDomain)
contextInfo
- businessDomain
- Copyright © 2021. All rights reserved.