/** * Returns <jk>true</jk> if the specified object is an instance of this class. * * <p> * This is a simple comparison on the base class itself and not on any generic parameters. * * @param o The object to check. * @return <jk>true</jk> if the specified object is an instance of this class. */ public boolean isInstance(Object o) { if (o != null) return isParentClass(this.innerClass, o.getClass()) || (isPrimitive() && getPrimitiveWrapper(this.innerClass) == o.getClass()); return false; }
/** * Returns <jk>true</jk> if the specified object is an instance of this class. * * <p> * This is a simple comparison on the base class itself and not on any generic parameters. * * @param o The object to check. * @return <jk>true</jk> if the specified object is an instance of this class. */ public boolean isInstance(Object o) { if (o != null) return isParentClass(this.innerClass, o.getClass()) || (isPrimitive() && getPrimitiveWrapper(this.innerClass) == o.getClass()); return false; }
/** * Returns <jk>true</jk> if the specified object is an instance of this class. * * <p> * This is a simple comparison on the base class itself and not on any generic parameters. * * @param o The object to check. * @return <jk>true</jk> if the specified object is an instance of this class. */ public boolean isInstance(Object o) { if (o != null) return isParentClass(this.innerClass, o.getClass()) || (isPrimitive() && getPrimitiveWrapper(this.innerClass) == o.getClass()); return false; }
public <T> T as(Class<T> c) { Class<?> c2 = ClassUtils.getPrimitiveWrapper(c); if (c2 != null) c = (Class<T>)c2; if (c.isInstance(value)) return (T)value; if (c.isArray() && value instanceof Collection) return (T)asArray(c.getComponentType()); if (type == STRING) { T t = ClassUtils.fromString(c, value.toString()); if (t != null) return t; } throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}'' on property ''{2}''", type, c, name); }
public <T> T as(Class<T> c) { Class<?> c2 = ClassUtils.getPrimitiveWrapper(c); if (c2 != null) c = (Class<T>)c2; if (c.isInstance(value)) return (T)value; if (c.isArray() && value instanceof Collection) return (T)asArray(c.getComponentType()); if (type == STRING) { T t = ClassUtils.fromString(c, value.toString()); if (t != null) return t; } throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}'' on property ''{2}''", type, c, name); }
public <T> T as(Class<T> c) { Class<?> c2 = ClassUtils.getPrimitiveWrapper(c); if (c2 != null) c = (Class<T>)c2; if (c.isInstance(value)) return (T)value; if (c.isArray() && value instanceof Collection) return (T)asArray(c.getComponentType()); if (type == STRING) { T t = ClassUtils.fromString(c, value.toString()); if (t != null) return t; } throw new ConfigException("Invalid property conversion ''{0}'' to ''{1}'' on property ''{2}''", type, c, name); }
final Class<?> oc2 = hasPrimitiveWrapper(oc) ? getPrimitiveWrapper(oc) : oc; if (oc2.isEnum()) { t = new Transform<String,O>() {
final Class<?> oc2 = hasPrimitiveWrapper(oc) ? getPrimitiveWrapper(oc) : oc; if (oc2.isEnum()) { t = new Transform<String,O>() {
final Class<?> oc2 = hasPrimitiveWrapper(oc) ? getPrimitiveWrapper(oc) : oc; if (oc2.isEnum()) { t = new Transform<String,O>() {