I'm thinking about adding convenient isInstance method to TypeInfo.
On ClassInfoImpl/JavassistTypeInfo it would use getType::isInstance,
but on PrimitiveInfo it would still look into progression.
The method would hide simple impl detail.
| TypeInfo ti = ...;
| Object value = ...; // not null
|
| //long version
| TypeInfoFactory tif = ti.getTypeInfoFactory();
| TypeInfo other = tif.getTypeInfo(value.getClass());
| boolean isInstance = ti.isAssignableFrom(other);
|
| // short
| boolean isInstance = ti.isInstance(value);
|
| // where this doesn't consider progression
| boolean isInstance = ti.getType().isInstance(value);
|
OK?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191505#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...