Returns enclosed object casted on given class, if enclosed object is not
instance of given class returns null.
@param clazz class to cast on
@return casted object or null
512331
private <T> T get(Class<T> clazz) {
    try {
      return clazz.cast(get());
    } catch (ClassCastException e) {
      return null;
    }
  }
385358
public static boolean isNormalClass(Class<?> clazz) {
		return null != clazz //
				&& false == clazz.isInterface() //
				&& false == isAbstract(clazz) //
				&& false == clazz.isEnum() //
				&& false == clazz.isArray() //
				&& false == clazz.isAnnotation() //
				&& false == clazz.isSynthetic() //
				&& false == clazz.isPrimitive();//
	}
502730
private AbstractManagedType getType(Class clazz, boolean isIdClass)
    {
        if (clazz != null && !clazz.equals(Object.class))
        {
            return processInternal(clazz, isIdClass);
        }
        return null;
    }
313014
public static <T> T readAsObjectOf(Class<T> clazz, String value) {
        final ObjectMapper mapper = new ObjectMapper();
        try {
            return mapper.readValue(value, clazz);
        } catch (IOException e) {
            LOGGER.error(e.getMessage(), e.fillInStackTrace());
        }
        return null;
    }
926849
@Override
    public <T> T getProperty(Object key, Class<T> clazz) {
        return clazz.cast(getProperty(key));
    }
979241
public static Constructor<?>[] getAllConstructors(Class<?> clazz) {
        Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors();
        for (Constructor<?> constructor : declaredConstructors) {
            if (!constructor.isAccessible()) {
                constructor.setAccessible(true);
            }
        }
        return declaredConstructors;
    }
574838
@SuppressWarnings("unchecked")
    public <T> Set<T> getSet(Class<T> clazz) {
        return (Set<T>) objects;
    }
1297573
public static Builder forClass(Class clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("class can not be null");
        }
        return new Builder(Collections.singletonList(clazz));
    }
482684
private static <T> T cast(Class<T> clazz, Object o) {
        if (! clazz.isInstance(o))
            throw new IllegalArgumentException(o.toString());
        return clazz.cast(o);
    }
952226
public static ClassLoader getClassLoader(final Class<?> clazz) {
        // Context class loader can be null
        final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        if (contextClassLoader != null) {
            return contextClassLoader;
        }
        if (clazz != null) {
            // The class loader for a specific class can also be null
            final ClassLoader clazzClassLoader = clazz.getClassLoader();
            if (clazzClassLoader != null) {
                return clazzClassLoader;
            }
        }
        // The only class loader we can rely on for not being null is the system
        // one
        return ClassLoader.getSystemClassLoader();
    }
1029247
public static Reflect onClass(String clazz) throws Exception {
      return new Reflect(null, ReflectionUtils.getClassForName(clazz));
   }
583932
public <X> X cast(final Class<X> cls) {
        if (cls == null) {
            throw new IllegalArgumentException("Parameter 'cls' muss angegeben werden");
        }

        final Class<?> beanClass = bean.getClass();
        if (cls.isAssignableFrom(beanClass)) {
            return cls.cast(bean);
        }
        throw new ClassCastException("Klasse " + beanClass + " kann nicht nach " + cls + " gewandelt werden");
    }
594396
public String getClassTypeName(Class<?> clazz) {
        
        String type = null;

        if (clazz.isInterface()) {
            type = "interface";
        }
        else if (clazz.isPrimitive() || clazz.isArray()) {
            // type already null
        }
        else {
            type = "class";
        }

        return type;
    }
668261
public static ClassLoader getClassLoader(Class<?> clazz) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader != null) {
            return loader;
        }
        if (clazz != null) {
            loader = clazz.getClassLoader();
            if (loader != null) {
                return loader;
            }
        }
        return ClassLoader.getSystemClassLoader();
    }
1217785
public <T> String create(Class<T> clazz) {
        return create(clazz, null, null);
    }
645703
public <T> Clazz<T> Clazz( Class<T> clazz )
	{
		_ensureMap();

		@SuppressWarnings( "unchecked" )
		Clazz<T> res = (Clazz<T>) clazzz.get( clazz );
		if( res == null )
			throw new IllegalArgumentException( "Class not supported by ClassInfo : " + clazz.getName() );

		return res;
	}
171181
@SuppressWarnings("unchecked")
    public <T> T getObjectByUuid(Class<T> clazz, String uuid) {
        return getObjectByUuid(clazz, UUID.fromString(uuid));
    }