public final class ObjectExtensions extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
clone(T object)
Try to clone the given generic object.
|
static Object |
cloneObject(Object object)
Try to clone the given object.
|
static Object |
cloneObjectQuietly(Object object)
Try to clone the given object quietly.
|
static boolean |
compare(Object sourceOjbect,
Object objectToCompare)
Compares the given two objects.
|
static int |
compareTo(Object sourceOjbect,
Object objectToCompare,
String property)
Compares the given object over the given property.
|
static int |
compareToQuietly(Object sourceOjbect,
Object objectToCompare,
String property)
Compares the given object over the given property quietly.
|
static <DESTINATION,ORIGINAL> |
copy(DESTINATION destination,
ORIGINAL original)
Copy the given original object to the given destination object.
|
static <DESTINATION,ORIGINAL> |
copyQuietly(DESTINATION destination,
ORIGINAL original)
Copy quietly the given original object to the given destination object.
|
static List<ChangedAttributeResult> |
getChangedData(Object sourceOjbect,
Object objectToCompare)
Gets the changed data.
|
static Map<Object,ChangedAttributeResult> |
getChangedDataMap(Object sourceOjbect,
Object objectToCompare)
Compares the given two objects and gets the changed data.
|
static Map<String,Integer> |
getCompareToResult(Object sourceOjbect,
Object objectToCompare)
Gets the compare to result.
|
static <DESTINATION,ORIGINAL> |
isCopyable(DESTINATION destination,
ORIGINAL original)
Checks if is copyable and copies if its possible otherwise it returns false.
|
public static <T> T clone(T object)
T - the generic typeobject - the object to clonepublic static Object cloneObject(Object object) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, InstantiationException, IOException
object - The object to clone.NoSuchMethodException - the no such method exceptionSecurityException - Thrown if the security manager indicates a security violation.IllegalAccessException - the illegal access exceptionIllegalArgumentException - the illegal argument exceptionInvocationTargetException - the invocation target exceptionClassNotFoundException - the class not found exceptionInstantiationException - the instantiation exceptionIOException - Signals that an I/O exception has occurred.public static Object cloneObjectQuietly(Object object)
object - The object to clone.public static boolean compare(Object sourceOjbect, Object objectToCompare) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
sourceOjbect - the source ojbectobjectToCompare - the object to compareIllegalAccessException - the illegal access exceptionInvocationTargetException - the invocation target exceptionNoSuchMethodException - the no such method exceptionpublic static int compareTo(Object sourceOjbect, Object objectToCompare, String property) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
sourceOjbect - the source ojbectobjectToCompare - the object to compareproperty - the propertyIllegalAccessException - the illegal access exceptionInvocationTargetException - the invocation target exceptionNoSuchMethodException - the no such method exceptionpublic static int compareToQuietly(Object sourceOjbect, Object objectToCompare, String property)
sourceOjbect - the source ojbectobjectToCompare - the object to compareproperty - the propertypublic static final <DESTINATION,ORIGINAL> void copy(DESTINATION destination,
ORIGINAL original)
throws IllegalAccessException,
InvocationTargetException
DESTINATION - the generic type of the destination object.ORIGINAL - the generic type of the original object.destination - the destination object.original - the original object.IllegalAccessException - the illegal access exceptionInvocationTargetException - the invocation target exceptionpublic static final <DESTINATION,ORIGINAL> DESTINATION copyQuietly(DESTINATION destination,
ORIGINAL original)
DESTINATION - the generic type of the destination object.ORIGINAL - the generic type of the original object.destination - the destination object.original - the original object.public static List<ChangedAttributeResult> getChangedData(Object sourceOjbect, Object objectToCompare) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
sourceOjbect - the source ojbectobjectToCompare - the object to compareIllegalAccessException - the illegal access exceptionInvocationTargetException - the invocation target exceptionNoSuchMethodException - the no such method exceptionpublic static Map<Object,ChangedAttributeResult> getChangedDataMap(Object sourceOjbect, Object objectToCompare) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
sourceOjbect - the source ojbectobjectToCompare - the object to compareIllegalAccessException - the illegal access exceptionInvocationTargetException - the invocation target exceptionNoSuchMethodException - the no such method exceptionpublic static Map<String,Integer> getCompareToResult(Object sourceOjbect, Object objectToCompare) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
sourceOjbect - the source ojbectobjectToCompare - the object to compareIllegalAccessException - the illegal access exceptionInvocationTargetException - the invocation target exceptionNoSuchMethodException - the no such method exceptionpublic static final <DESTINATION,ORIGINAL> boolean isCopyable(DESTINATION destination,
ORIGINAL original)
DESTINATION - the generic type of the destination object.ORIGINAL - the generic type of the original object.destination - the destination object.original - the original object.Copyright © 2007–2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.