<p>judge the given data object is instance of the given type or not.</p>

@param data the data object.
@param type the given class to test.
@return true or false as described.
165083
public static boolean instanceOf(Object data, Class type) {
        //这里有一个事实,即参数data必定是非原生类型,即使传入时是原生类型,它也被java强制转化为Object非原生了.
        //here we rely on the jdk default behavior of packing primitive type parameter into packed type,
        //which means that if you passe an int to the data parameter, right here within this method,
        //you will always get an Integer object.
        if (type.isInstance(data)) {
            return true;
        }
        if (data == null) {
            return false;
        }
        if (type.isPrimitive()) {
            if (type == int.class) {
                type = Integer.class;
            } else if (type == long.class) {
                type = Long.class;
            } else if (type == short.class) {
                type = Short.class;
            } else if (type == double.class) {
                type = Double.class;
            } else if (type == float.class) {
                type = Float.class;
            } else if (type == char.class) {
                type = Character.class;
            } else if (type == byte.class) {
                type = Byte.class;
            } else if (type == boolean.class) {
                type = Boolean.class;
            }
        }
        return type.isInstance(data);
    }
1331477
private static boolean isDesignerClass(Class<?> type) {
        return Stream.of(type.getDeclaredFields()).anyMatch(field -> TestDesigner.class.isAssignableFrom(field.getType()));
    }
372335
public <T> T dataToType(Class<T> type) {
        return Reflection.toType(data, type);
    }
1192952
public boolean isKindOf(final Type _type)
    {
        boolean ret = false;
        Type type = this;
        while (type != null && type.getId() != _type.getId()) {
            type = type.getParentType();
        }
        if (type != null && type.getId() == _type.getId()) {
            ret = true;
        }
        return ret;
    }
733663
public static boolean isPrimitiveBoolean(final Class<?> type) {
        ArgUtils.notNull(type, "type");
        
        if(type.isPrimitive() && boolean.class.isAssignableFrom(type)) {
            return true;
        }
        
        return false;
    }
482003
public static boolean isPropertyType(final Type type) {
        if (type instanceof GenericArrayType) {
            return isPropertyType(((GenericArrayType) type).getGenericComponentType());
        }
        if (type instanceof ParameterizedType) {
            return isPropertyType(((ParameterizedType) type).getRawType());
        }
        return type instanceof Class && isPropertyType((Class) type);
    }
43988
static boolean isSafeReturnType(Class<?> type) { 
        return !ConnectionPoolDataSource.class.isAssignableFrom(type)
               && !CommonDataSource.class.isAssignableFrom(type) 
               && !XADataSource.class.isAssignableFrom(type)
               && !DataSource.class.isAssignableFrom(type)
               && !PooledConnection.class.isAssignableFrom(type) // implies XAConnection
               && !Connection.class.isAssignableFrom(type)
               && !DatabaseMetaData.class.isAssignableFrom(type)
               && !Statement.class.isAssignableFrom(type) // implies prepared & callable
               && !ResultSet.class.isAssignableFrom(type)
               && !XAResource.class.isAssignableFrom(type);
    }
873818
public static boolean isBoolean(final Class type) {
		if (Boolean.class.isAssignableFrom(type)) {
			return true;
		}
		return type.getName().equals("boolean");
	}
891602
def _is_numeric_data(self, data_type):
        """"""
        dt = DATA_TYPES[data_type]
        if dt['min'] and dt['max']:
            if type(self.data) is dt['type'] and dt['min'] < self.data < dt['max']:
                self.type = data_type.upper()
                self.len = len(str(self.data))
                return True
1126383
@Override
  public void add(Object data, Class<?>... typeSpecs) {
    //    if (data == null) return;
    //
    //    typeSpecs = determineTypeSpecs(data, typeSpecs);
    //    if (this.getDefaultDataType() == null) this.setDefaultDataType(typeSpecs);
    //
    //    mReps.put(this.getSpecsAsString(typeSpecs), data);
    Representation representation = new Representation(data, typeSpecs);
    mReps.put(representation.getTypeSpecsString(), representation);
  }
143745
public void remove(Class<? extends T> type) throws IOException {
        for (T t : data) {
            if(t.getClass()==type) {
                data.remove(t);
                onModified();
                return;
            }
        }
    }
1367774
private void checkIsCastableToDefinedType(Option o, Map<String, String> data) throws RequiredParametersException {
		if (o.hasType() && !o.isCastableToDefinedType(data.get(o.getName()))) {
			throw new RequiredParametersException("Value for parameter " + o.getName() +
					" cannot be cast to type " + o.getType());
		}
	}
1294410
public void writeData(Object[] data, Type[] types) {
        writeData(types.length, types, data, null, null);
    }
313813
static boolean isAdapterType(Element element, Elements elements, Types types) {
    TypeMirror typeAdapterType = types.getDeclaredType(
        elements.getTypeElement(TYPE_ADAPTER_CLASS_NAME),
        types.getWildcardType(null, null));
    return types.isAssignable(element.asType(), typeAdapterType);
  }
20431
public boolean isValid(TagData data) {
        TagExtraInfo tei = getTagExtraInfo();
        if (tei == null) {
	    return true;
        }
        return tei.isValid(data);
    }
140159
public boolean isKindOf(final org.efaps.admin.datamodel.Type _type)
    {
        return getType().isKindOf(_type);
    }
121053
public boolean hasException(Class<? extends Throwable> type) {
        for (Throwable exception : exceptions) {
            if (type.isInstance(exception)) {
                return true;
            }
        }
        
        return false;
    }