public class CglibUtil extends Object
Constructor and Description |
---|
CglibUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
copy(Object source,
Class<T> targetClass)
拷贝Bean对象属性到目标类型
此方法通过指定目标类型自动创建之,然后拷贝属性 |
static <T> T |
copy(Object source,
Class<T> targetClass,
net.sf.cglib.core.Converter converter)
拷贝Bean对象属性
此方法通过指定目标类型自动创建之,然后拷贝属性 |
static void |
copy(Object source,
Object target)
拷贝Bean对象属性
|
static void |
copy(Object source,
Object target,
net.sf.cglib.core.Converter converter)
拷贝Bean对象属性
|
static <S,T> List<T> |
copyList(Collection<S> source,
Supplier<T> target)
拷贝List Bean对象属性
|
static <S,T> List<T> |
copyList(Collection<S> source,
Supplier<T> target,
BiConsumer<S,T> callback)
拷贝List Bean对象属性
|
static <S,T> List<T> |
copyList(Collection<S> source,
Supplier<T> target,
net.sf.cglib.core.Converter converter)
拷贝List Bean对象属性
|
static <S,T> List<T> |
copyList(Collection<S> source,
Supplier<T> target,
net.sf.cglib.core.Converter converter,
BiConsumer<S,T> callback)
拷贝List Bean对象属性
|
static <T> T |
fillBean(Map map,
T bean)
将Map中的内容填充至Bean中
|
static <T> T |
toBean(Map map,
Class<T> beanClass)
将Map转换为Bean
|
static net.sf.cglib.beans.BeanMap |
toMap(Object bean)
将Bean转换为Map
|
public static <T> T copy(Object source, Class<T> targetClass)
T
- 目标对象类型source
- 源bean对象targetClass
- 目标bean类,自动实例化此对象public static <T> T copy(Object source, Class<T> targetClass, net.sf.cglib.core.Converter converter)
T
- 目标对象类型source
- 源bean对象targetClass
- 目标bean类,自动实例化此对象converter
- 转换器,无需可传null
public static void copy(Object source, Object target)
source
- 源bean对象target
- 目标bean对象public static void copy(Object source, Object target, net.sf.cglib.core.Converter converter)
source
- 源bean对象target
- 目标bean对象converter
- 转换器,无需可传null
public static <S,T> List<T> copyList(Collection<S> source, Supplier<T> target)
S
- 源bean类型T
- 目标bean类型source
- 源bean对象listtarget
- 目标bean对象public static <S,T> List<T> copyList(Collection<S> source, Supplier<T> target, net.sf.cglib.core.Converter converter)
S
- 源bean类型T
- 目标bean类型source
- 源bean对象listtarget
- 目标bean对象converter
- 转换器,无需可传null
public static <S,T> List<T> copyList(Collection<S> source, Supplier<T> target, BiConsumer<S,T> callback)
S
- 源bean类型T
- 目标bean类型source
- 源bean对象listtarget
- 目标bean对象callback
- 回调对象public static <S,T> List<T> copyList(Collection<S> source, Supplier<T> target, net.sf.cglib.core.Converter converter, BiConsumer<S,T> callback)
S
- 源bean类型T
- 目标bean类型source
- 源bean对象listtarget
- 目标bean对象converter
- 转换器,无需可传null
callback
- 回调对象public static net.sf.cglib.beans.BeanMap toMap(Object bean)
bean
- Bean对象BeanMap
public static <T> T fillBean(Map map, T bean)
T
- Bean类型map
- Mapbean
- BeanCopyright © 2024. All rights reserved.