@Singleton public class CloneHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
CloneHelper.PropertyInfo |
| Modifier and Type | Field and Description |
|---|---|
protected static Set<Class<?>> |
FINAL_IMMUTABLES |
protected ReflectionHelper |
reflectionHelper |
| Constructor and Description |
|---|
CloneHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
clone(T source,
Map<Object,Object> instanceMap) |
protected Object |
cloneArray(Object source,
Class<?> sourceClass,
boolean finalImmutable,
Map<Object,Object> instanceMap) |
<T> T |
cloneBean(T source)
Clone the source bean and the properties of the source bean recursively (deep copy).
|
protected <T> T |
cloneBean(T source,
Map<Object,Object> instanceMap) |
protected <T> Collection<T> |
cloneCollection(Collection<T> collection,
Map<Object,Object> instanceMap) |
protected <T,R> Map<T,R> |
cloneMap(Map<T,R> map,
Map<Object,Object> instanceMap) |
protected <T> void |
cloneProperties(T source,
T destination,
Map<Object,Object> instanceMap) |
protected <T> T |
createClone(T source) |
protected <T> Collection<T> |
createCollection(Collection<T> sourceCollection) |
protected <T> T |
createCustomClone(T source,
Map<Object,Object> instanceMap) |
protected <T,R> Map<T,R> |
createMap(Map<T,R> sourceMap) |
protected CloneHelper.PropertyInfo |
createPropertyInfo(Class<?> valueClass,
Method readMethod,
Method writeMethod) |
protected CloneHelper.PropertyInfo[] |
getPropertyInfos(Class<?> sourceClass) |
protected boolean |
isCloneRequired(Class<?> sourceClass) |
protected boolean |
isImmutable(Class<?> valueClass) |
@Inject protected ReflectionHelper reflectionHelper
public <T> T cloneBean(T source)
source - protected <T> T createClone(T source)
protected <T> void cloneProperties(T source,
T destination,
Map<Object,Object> instanceMap)
protected <T> Collection<T> createCollection(Collection<T> sourceCollection)
protected boolean isCloneRequired(Class<?> sourceClass)
protected boolean isImmutable(Class<?> valueClass)
protected Object cloneArray(Object source, Class<?> sourceClass, boolean finalImmutable, Map<Object,Object> instanceMap)
protected <T> Collection<T> cloneCollection(Collection<T> collection, Map<Object,Object> instanceMap)
protected CloneHelper.PropertyInfo[] getPropertyInfos(Class<?> sourceClass)
protected CloneHelper.PropertyInfo createPropertyInfo(Class<?> valueClass, Method readMethod, Method writeMethod)
Copyright © 2017. All rights reserved.