Checks if is assignable.

@param typeName
the type name
@param assignableClazz
the assignable clazz
@return true, if is assignable
192324
public static boolean isAssignable(TypeName typeName, Class<?> assignableClazz) {
		try {
			if (typeName instanceof ParameterizedTypeName) {
				typeName = ((ParameterizedTypeName) typeName).rawType;
			} else if (typeName instanceof ArrayTypeName) {
				typeName = ((ArrayTypeName) typeName).componentType;
			}

			Class<?> resolvedType = Class.forName(typeName.toString());
			return assignableClazz.isAssignableFrom(resolvedType);
		} catch (ClassNotFoundException e) {
			return false;
		}
	}
1337244
private static boolean isLoadable(Class<?> clazz, ClassLoader classLoader) {
        try {
            return (clazz == classLoader.loadClass(clazz.getName()));
            // Else: different class with same name found
        } catch (ClassNotFoundException ex) {
            // No corresponding class found at all
            return false;
        }
    }
1286065
public static boolean isAssignableFrom(Class<?> dest, Class<?> src)
   {
      if (dest == null || src == null)
         throw MESSAGES.cannotCheckClassIsAssignableFrom(dest, src);

      boolean isAssignable = dest.isAssignableFrom(src);
      if (isAssignable == false && dest.getName().equals(src.getName()))
      {
         ClassLoader destLoader = dest.getClassLoader();
         ClassLoader srcLoader = src.getClassLoader();
         if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.notAssignableDueToConflictingClassLoaders(dest, src, destLoader, srcLoader);
      }

      if (isAssignable == false && isPrimitive(dest))
      {
         dest = getWrapperType(dest);
         isAssignable = dest.isAssignableFrom(src);
      }
      if (isAssignable == false && isPrimitive(src))
      {
         src = getWrapperType(src);
         isAssignable = dest.isAssignableFrom(src);
      }
      return isAssignable;
   }
471304
public boolean isAvailable(QualifiedName name) {
		SymbolTable.Group group = symbolTable.get(name.getUnit());
		return group != null && group.isAvailable(name.getName());
	}
1152864
static boolean isJavaBaseAssignable( Class<?> lhsType, Class<?> rhsType )
    {
        /*
            Assignment to loose type, defer to bsh extensions
            Note: we could shortcut this here:
            if ( lhsType == null ) return true;
            rather than forcing another round.  It's not strictly a Java issue,
            so does it belong here?
        */
        if ( lhsType == null )
            return false;

        // null rhs type corresponds to type of Primitive.NULL assignable to any
        // object type but we give preference here to string types
        if ( rhsType == null )
            return lhsType == String.class;

        if ( lhsType.isPrimitive() && rhsType.isPrimitive() ) {
            if ( lhsType == rhsType )
                return true;

            // handle primitive widening conversions - JLS 5.1.2
            if ( NUMBER_ORDER.containsKey(rhsType)
                    && NUMBER_ORDER.containsKey(lhsType) )
                return NUMBER_ORDER.get(rhsType) < NUMBER_ORDER.get(lhsType);
        }
        else if ( lhsType.isAssignableFrom(rhsType) )
            return true;

        return false;
    }
522168
public static boolean isSupportedJDKType(TypeName typeName) {
		if (typeName.isPrimitive()) {
			return getPrimitiveTransform(typeName) != null;
		}

		String name = typeName.toString();

		if (name.startsWith("java.lang")) {
			return getLanguageTransform(typeName) != null;
		}

		if (name.startsWith("java.util")) {
			return getUtilTransform(typeName) != null;
		}

		if (name.startsWith("java.math")) {
			return getMathTransform(typeName) != null;
		}

		if (name.startsWith("java.net")) {
			return getNetTransform(typeName) != null;
		}

		if (name.startsWith("java.sql")) {
			return getSqlTransform(typeName) != null;
		}

		return false;
	}
306402
public static String getTypeName(Class<?> clazz) {
		Type typeAnnotation = clazz.getAnnotation(Type.class);
		return typeAnnotation != null ? typeAnnotation.value() : null;
	}
423556
private boolean isCompatibleClass(Class checkClass)
    {
        //
        // If the check class is equal to or a super-interface of the map class, then
        // they are compatible.
        //
        if (_mapClass.isAssignableFrom(checkClass))
            return true;

        //
        // If the check class is a property set declared by the map class or a super interface
        // of the map class, then they are compatible.
        //
        if (checkClass.isAnnotationPresent(PropertySet.class))
        {
            Class declaringClass = checkClass.getDeclaringClass();

            // External property sets are always compatible.
            // TODO: Could do a more extensive check..
            if (declaringClass == null)
                return true;

            if (declaringClass.isAssignableFrom(_mapClass))
                return true;
        }

        //
        // If the map class is a property set declared by the check class or a super interface
        // of the check class, then they are compatible.  This is the inverse of the last check,
        // and happens e.g. when a programatically instantiated control w/ an initial property
        // map needs to delegate to the control interface's property map.
        //
        if (_mapClass.isAnnotationPresent(PropertySet.class))
        {
            Class declaringClass = _mapClass.getDeclaringClass();
            if (declaringClass != null &&
                declaringClass.isAssignableFrom(checkClass))
                return true;

            // External property sets have no declaring class
            if (declaringClass == null)
            {
                ExternalPropertySets eps = (ExternalPropertySets) checkClass.getAnnotation(ExternalPropertySets.class);
                if (eps != null)
                {
                    Class[] propSets = eps.value();
                    if (propSets != null)
                    {
                        for (Class ps : propSets)
                        {
                            if (_mapClass.equals(ps))
                                return true;
                        }
                    }
                }
            }
        }

        return false;
    }
558959
private boolean isPolymorphicType(Class<?> clazz) {
    return polymorphicTypes.stream().anyMatch(polymorphicType -> polymorphicType.getConfigClass() == clazz);
  }
1331758
private static boolean isSupportedClass(Class<?> clazz) {
        return Observable.class.isAssignableFrom(clazz) ||
               Maybe.class.isAssignableFrom(clazz) ||
               Single.class.isAssignableFrom(clazz) ||
               Completable.class.isAssignableFrom(clazz);
    }
1217243
public static boolean isClassOrInterface(Type type) {
    if (!(type instanceof Class)) {
      return false;
    }

    Class clazz = (Class) type;
    return !clazz.isPrimitive() && !clazz.isAnnotation() && !clazz.isArray() && !clazz.isEnum()
        && !clazz.isAnonymousClass();
  }
1041188
private boolean isTypeAnnotationAllowedForName(Node n) {
    checkState(n.isName(), n);
    // Only allow type annotations on nodes used as an lvalue.
    if (!NodeUtil.isLValue(n)) {
      return false;
    }
    // Don't allow JSDoc on a name in an assignment. Simple names should only have JSDoc on them
    // when originally declared.
    Node rootTarget = NodeUtil.getRootTarget(n);
    return !NodeUtil.isLhsOfAssign(rootTarget);
  }
1116405
public final boolean isPropertyTypeDeclared(String propertyName) {
    StaticTypedSlot slot = getSlot(propertyName);
    return slot == null ? false : !slot.isTypeInferred();
  }
14064
public boolean isListableType() {
        return (type == ItemType.ARRAY || type == ItemType.LIST || type == ItemType.SET);
    }
448689
public static boolean isClassAvailable(final String className) {
        try {
            final Class<?> clazz = loadClass(className);
            return clazz != null;
        } catch (final ClassNotFoundException | LinkageError e) {
            return false;
        } catch (final Throwable e) {
            LowLevelLogUtil.logException("Unknown error checking for existence of class: " + className, e);
            return false;
        }
    }
313939
@Override
    public <TYPE extends Assignable> TYPE as(final Class<TYPE> clazz) {
        Validate.notNull(clazz, "Class must be specified");

        return this.configuration.getExtensionLoader().load(clazz, this);
    }
754567
static boolean isJavaBoxTypesAssignable(
        Class lhsType, Class rhsType )
    {
        // Assignment to loose type... defer to bsh extensions
        if ( lhsType == null )
            return false;

        // prim can be boxed and assigned to Object
        if ( lhsType == Object.class )
            return true;

        // null rhs type corresponds to type of Primitive.NULL
        // assignable to any object type but not array
        if (rhsType == null)
            return !lhsType.isPrimitive() && !lhsType.isArray();

        // prim numeric type can be boxed and assigned to number
        if ( lhsType == Number.class
            && rhsType != Character.TYPE
            && rhsType != Boolean.TYPE
        )
            return true;

        // General case prim type to wrapper or vice versa.
        // I don't know if this is faster than a flat list of 'if's like above.
        // wrapperMap maps both prim to wrapper and wrapper to prim types,
        // so this test is symmetric
        if ( Primitive.wrapperMap.get( lhsType ) == rhsType )
            return true;

        return isJavaBaseAssignable(lhsType, rhsType);
    }