public class BeanMapper extends Object
Constructor and Description |
---|
BeanMapper(Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
BeanMapperBuilder |
config()
Deprecated.
use wrap() instead
|
Configuration |
getConfiguration() |
<S,T> List<T> |
map(List<S> list,
Class<T> elementInListClass)
Maps the source list of elements to a new target list.
|
<K,S,T> Map<K,T> |
map(Map<K,S> map,
Class<T> mapValueClass)
Maps the source map of elements to a new target map.
|
Object |
map(Object source) |
<S,T> T |
map(S source,
Class<T> targetClass)
Copies the values from the source object to a newly constructed target instance
|
<S,T> Set<T> |
map(Set<S> set,
Class<T> elementInSetClass)
Maps the source set of elements to a new target set.
|
<S,T> T |
map(S source,
T target)
Copies the values from the source object to an existing target instance
|
BeanMapperBuilder |
wrap() |
BeanMapperBuilder |
wrapConfig()
Deprecated.
use wrap() instead
|
public BeanMapper(Configuration configuration)
public <S,T> T map(S source, T target)
S
- the instance from which the properties get copied.T
- the instance to which the properties get copiedsource
- source instance of the propertiestarget
- target instance for the propertiespublic <S,T> T map(S source, Class<T> targetClass)
S
- The instance from which the properties get copiedT
- the instance to which the properties get copiedsource
- source instance of the propertiestargetClass
- class of the target, needs to be constructed as the target instancepublic <S,T> List<T> map(List<S> list, Class<T> elementInListClass)
S
- the class type of the source listT
- the class type of an element in the target listlist
- the source listelementInListClass
- the class of each element in the target listpublic <S,T> Set<T> map(Set<S> set, Class<T> elementInSetClass)
S
- the class type of the source setT
- the class type of an element in the target setset
- the source setelementInSetClass
- the class of each element in the target setpublic <K,S,T> Map<K,T> map(Map<K,S> map, Class<T> mapValueClass)
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 mapmap
- the source mapmapValueClass
- the class of each value in the target mappublic final Configuration getConfiguration()
public BeanMapperBuilder config()
public BeanMapperBuilder wrapConfig()
public BeanMapperBuilder wrap()
Copyright © 2015–2018 42 BV. All rights reserved.