Package io.beanmapper
Class BeanMapper
java.lang.Object
io.beanmapper.BeanMapper
Class that is responsible first for understanding the semantics of the source and target
objects. Once that has been determined, the applicable properties will be copied from
source to target.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconfig()
Deprecated.use wrap() instead<S, T> List<T>
Maps the source list of elements to a new target list.<K, S, T> Map<K,T>
Maps the source map of elements to a new target map.<S, T> Set<T>
Maps the source set of elements to a new target set.<S, T> T
Copies the values from the source object to a newly constructed target instance<S, T> T
map(S source, T target)
Copies the values from the source object to an existing target instancewrap()
Deprecated.use wrap() instead
-
Constructor Details
-
BeanMapper
-
-
Method Details
-
map
-
map
public <S, T> T map(S source, T target)Copies the values from the source object to an existing target instance- Type Parameters:
S
- the instance from which the properties get copied.T
- the instance to which the properties get copied- Parameters:
source
- source instance of the propertiestarget
- target instance for the properties- Returns:
- the original target instance containing all applicable properties
-
map
Copies the values from the source object to a newly constructed target instance- Type Parameters:
S
- The instance from which the properties get copiedT
- the instance to which the properties get copied- Parameters:
source
- source instance of the propertiestargetClass
- class of the target, needs to be constructed as the target instance- Returns:
- the target instance containing all applicable properties
-
map
Maps the source list of elements to a new target list. Convenience operator- Type Parameters:
S
- the class type of the source listT
- the class type of an element in the target list- Parameters:
list
- the source listelementInListClass
- the class of each element in the target list- Returns:
- the target list with mapped source list elements
-
map
Maps the source set of elements to a new target set. Convenience operator- Type Parameters:
S
- the class type of the source setT
- the class type of an element in the target set- Parameters:
set
- the source setelementInSetClass
- the class of each element in the target set- Returns:
- the target set with mapped source set elements
-
map
Maps the source map of elements to a new target map. Convenience operator- Type Parameters:
K
- the class type of a key in both source and target mapT
- the class type of a value in the target mapS
- the class type of the source map- Parameters:
map
- the source mapmapValueClass
- the class of each value in the target map- Returns:
- the target map with literal source set keys and mapped source set values
-
getConfiguration
-
config
Deprecated.use wrap() instead- Returns:
- BeanMapperBuilder
-
wrapConfig
Deprecated.use wrap() instead- Returns:
- BeanMapperBuilder
-
wrap
-