Lines Matching defs:toType
324 * @param toType Type to convert to
326 * @return True if 'fromType' can be passed to an argument of 'toType'
328 private boolean isAdaptableTo(Class<?> fromType, Class<?> toType, boolean strict) {
329 if (fromType.equals(toType)) {
334 if (toType.isPrimitive()) {
336 Wrapper wto = forPrimitiveType(toType);
340 return toType.isAssignableFrom(wfrom.wrapperType());
343 if (toType.isPrimitive()) {
348 Wrapper wto = forPrimitiveType(toType);
355 // both are reference types: fromType should be a superclass of toType.
356 return !strict || toType.isAssignableFrom(fromType);
364 * @return True if 'fromType' can be converted to 'toType'
366 private boolean isAdaptableToAsReturn(Class<?> fromType, Class<?> toType) {
367 return toType.equals(void.class)
368 || !fromType.equals(void.class) && isAdaptableTo(fromType, toType, false);
370 private boolean isAdaptableToAsReturnStrict(Class<?> fromType, Class<?> toType) {
371 if (fromType.equals(void.class) || toType.equals(void.class)) return fromType.equals(toType);
372 else return isAdaptableTo(fromType, toType, true);