public class CloneUtils extends Object
| Constructor and Description |
|---|
CloneUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <O> O |
deepClone(O original) |
protected static Object |
deepCloneList(Object original,
Map<Object,Object> cache,
boolean referenceCollectionCopy) |
protected static Object |
deepCloneMap(Object original,
Map<Object,Object> cache,
boolean referenceCollectionCopy) |
protected static Object |
deepCloneObject(Object original,
Map<Object,Object> cache) |
static <O> O |
deepCloneReflection(O original) |
protected static Object |
deepCloneReflectionInternal(Object original,
Map<Object,Object> cache,
boolean referenceCollectionCopy) |
static boolean |
fieldHasAnnotation(Class<?> clazz,
String propertyName,
Class<? extends Annotation> annotationClass)
Determines whether the property of the given class has the given annotation specified
|
protected static List<Class<?>> |
getClassHierarchy(Class<?> c,
boolean includeInterfaces) |
static Field[] |
getFields(Class<?> c,
boolean includeStatic) |
static Field[] |
getFields(Class<?> c,
boolean includeStatic,
boolean includeTransient) |
static Field[] |
getFields(Object object,
boolean includeStatic) |
static Field[] |
getFields(Object object,
boolean includeStatic,
boolean includeTransient) |
static Map<String,Annotation> |
getFieldsWithAnnotation(Class<?> clazz,
Class<? extends Annotation> annotationClass)
Retrieves all field names for the given class that have the given annotation
|
protected static Object |
instantiate(Object original) |
protected static Field |
internalField(Object object,
String fieldName) |
public CloneUtils()
public static final <O> O deepClone(O original)
public static final <O> O deepCloneReflection(O original) throws Exception
Exceptionprotected static final Object deepCloneReflectionInternal(Object original, Map<Object,Object> cache, boolean referenceCollectionCopy) throws Exception
Exceptionprotected static Object deepCloneObject(Object original, Map<Object,Object> cache) throws Exception
Exceptionprotected static Object deepCloneMap(Object original, Map<Object,Object> cache, boolean referenceCollectionCopy) throws Exception
Exceptionprotected static Object deepCloneList(Object original, Map<Object,Object> cache, boolean referenceCollectionCopy) throws Exception
Exceptionpublic static Map<String,Annotation> getFieldsWithAnnotation(Class<?> clazz, Class<? extends Annotation> annotationClass)
clazz - - class to find field annotations forannotationClass - - class for annotation to findpublic static boolean fieldHasAnnotation(Class<?> clazz, String propertyName, Class<? extends Annotation> annotationClass)
clazz - - class containing the property to checkpropertyName - - name of the property to checkannotationClass - - class for the annotation to look forprotected static final Object instantiate(Object original) throws InstantiationException, IllegalAccessException
public static Field[] getFields(Object object, boolean includeStatic, boolean includeTransient)
public static Field[] getFields(Class<?> c, boolean includeStatic, boolean includeTransient)
protected static final Field internalField(Object object, String fieldName)
protected static List<Class<?>> getClassHierarchy(Class<?> c, boolean includeInterfaces)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.