|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.Objects
public final class Objects
A collection of Object
utilities.
Constructor Summary | |
---|---|
Objects()
|
Method Summary | |
---|---|
static Object |
copy(Serializable obj)
Copy an serializable object deeply. |
static Object |
deref(Object obj)
Dereference the given object if it is non-null and is an instance of Reference . |
static boolean |
equals(Object[] a,
Object[] b)
Test the equality of two object arrays. |
static boolean |
equals(Object[] a,
Object[] b,
boolean deep)
Test the equality of two object arrays. |
static Constructor |
getCompatibleConstructor(Class type,
Class valueType)
Get a compatible constructor for the given value type |
static boolean |
isArray(Object obj)
Check if the given object is an array (primitve or native). |
static Object[] |
toArray(Object obj)
Return an Object array for the given object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Objects()
Method Detail |
---|
public static Constructor getCompatibleConstructor(Class type, Class valueType)
type
- Class to look for constructor invalueType
- Argument type for constructor
public static Object copy(Serializable obj) throws IOException, ClassNotFoundException
obj
- Object to copy.
IOException
ClassCastException
ClassNotFoundException
public static Object deref(Object obj)
Reference
. If the object is null
then null is returned. If the object is not an instance of
Reference
, then the object is returned.
obj
- Object to dereference.
public static boolean isArray(Object obj)
obj
- Object to test.
public static Object[] toArray(Object obj)
obj
- Object to convert to an array. Converts primitive
arrays to Object arrays consisting of their wrapper
classes. If the object is not an array (object or primitve)
then a new array of the given type is created and the
object is set as the sole element.public static boolean equals(Object[] a, Object[] b, boolean deep)
a
- The first array.b
- The second array.deep
- True to traverse elements which are arrays.
public static boolean equals(Object[] a, Object[] b)
a
- The first array.b
- The second array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |