public class WrapUtils
extends java.lang.Object
Wrapper
class.Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
getWrapped(java.lang.Object obj)
Returns the object on which a given object is based.
|
static java.lang.Object |
getWrapped(java.lang.Object obj,
java.lang.Class<?> clazz)
Attempts to return an object of a given class on which a given
object is based.
|
public static java.lang.Object getWrapped(java.lang.Object obj)
obj
is a Wrapper
, it is unwrapped as far
as possible and the base object is returned.
Otherwise obj
itself is returned.obj
- test objectobj
public static java.lang.Object getWrapped(java.lang.Object obj, java.lang.Class<?> clazz)
Wrapper.getBase()
) until an
object of class clazz
is found, at which point it
is returned. If no clazz
object can be found,
null
is returned.obj
- test objectclazz
, or null