Converts this object to another object of class <code>clazz</code>.

@return a new object of the specified class.
971242
public <T extends MailChimpObject> T as(Class<T> clazz) {
		return fromJson(toJson(), clazz);
	}
987001
@SuppressWarnings("unchecked")
  public <T extends Entity<?>> T newInstance(final Class<T> clazz) {
    return (T) getEntityType(clazz).newInstance();
  }
1297573
public static Builder forClass(Class clazz) {
        if (clazz == null) {
            throw new IllegalArgumentException("class can not be null");
        }
        return new Builder(Collections.singletonList(clazz));
    }
333745
public <T> T convert(Object value, Class<T> clazz) {
    if (null == value) return null;
    if (value instanceof String && Strings.isEmpty((String) value)) { return null; }
    if (value.getClass().isArray()) {
      Object[] values = (Object[]) value;
      if (values.length >= 1) {
        value = values[0];
      }
    }
    return conversion.convert(value, clazz);
  }
1270739
public static File getClassJar(Class clazz) {
		File file = null;

		try {
			file = new File(clazz.getProtectionDomain().getCodeSource().getLocation().toURI());
		} catch (URISyntaxException e) {}

		return file;
	}
435569
public Class createClass(String className) throws ClassNotFoundException {
        Class clazz;
        try {
            clazz = Class.forName(className);
            return clazz;

        } catch (ExceptionInInitializerError eiie) {
            String info = "Could not load the " + description + " object: " + className
                    + ". Could not initialize static object in server: ";
            info += eiie.getMessage();
            throw new ClassNotFoundException(info, eiie);

        } catch (LinkageError le) {
            String info = "Could not load the " + description + " object: " + className
                    + ". This object is depending on a class that has been changed after compilation ";
            info += "or a class that was not found: ";
            info += le.getMessage();
            throw new ClassNotFoundException(info, le);

        } catch (ClassNotFoundException cnfe) {
            String info = "Could not find the " + description + " object: " + className + ": ";
            info += cnfe.getMessage();
            throw new ClassNotFoundException(info, cnfe);
        }
    }
1342280
public static Object loadInstance(Class clazz) throws ClassException {
	try {
	    return clazz.newInstance();
	}
	catch (InstantiationException e) {
	    throw new ClassException("the specified class object [" + clazz.getName() + "()] cannot be instantiated");
	}
	catch (IllegalAccessException e) {
	    throw new ClassException("can't load class because the currently executing method does not have access to the definition of the specified class");
	}
    }
221600
@SuppressWarnings("unchecked")
    public final Object createInstance(final SgClass clasz) {

        final Class newClass = createClass(clasz);
        return createInstance(newClass, new Class[] {}, new Object[] {});

    }
65536
public Object createObject(String className, Class clazz) throws ClassNotFoundException {
        Object object;
        try {
            object = clazz.newInstance();

        } catch (InstantiationException ie) {
            String info = "Could not create " + description + " object: " + className
                    + ". Could not access object constructor: ";
            info += ie.getMessage();
            throw new ClassNotFoundException(info, ie);

        } catch (IllegalAccessException iae) {
            String info = "Could not create " + description + " object: " + className
                    + ". Could not instantiate object. Does the object classname refer to an abstract class, "
                    + "an interface or the like?: ";
            info += iae.getMessage();
            throw new ClassNotFoundException(info, iae);

        } catch (ClassCastException cce) {
            String info = "Could not create " + description + " object: " + className
                    + ". The specified object classname does not refer to the proper type: ";
            info += cce.getMessage();
            throw new ClassNotFoundException(info, cce);
        }

        return object;
    }
112647
public <T> T toBean(Class<T> clazz) {
		return BeanUtil.mapToBean(this, clazz, false);
	}
123151
@Nonnull
  public static DAType from(@Nonnull Class<?> clazz) {
    return instance(clazz.getSimpleName(), clazz.getCanonicalName(), Collections.<DAType>emptyList());
  }
561376
public <T extends DajlabModelInterface> T get(Class<T> clazz) {

		T ret = null;
		try {
			ret = (T) dajlab.get(clazz.getName());
		} catch (ClassCastException e) {
			e.printStackTrace();
		}
		return ret;
	}
733491
public static Class convertPrimitiveToWrapper(Class clazz) {
		if (clazz == null || !clazz.isPrimitive())
			return clazz;

		return (Class) primativeToWrapperMap.get(clazz);
	}
462218
static <T> T convertToCustomClass(Object object, Class<T> clazz) {
    return deserializeToClass(object, clazz, ErrorPath.EMPTY);
  }
1161438
public static Object buildObjectInstance(Class<?> clazz) {
		Object rets = null;
		try {
			rets = clazz.newInstance();
		} catch (Exception e) {
			throw new BundlingProcessException(e.getMessage() + " [The custom class " + clazz.getName()
					+ " could not be instantiated, check whether it is available on the classpath and"
					+ " verify that it has a zero-arg constructor].\n" + " The specific error message is: "
					+ e.getClass().getName() + ":" + e.getMessage(), e);
		}
		return rets;
	}
781834
public static <T extends Entity<?>> T newInstance(final Class<T> clazz) {
    return meta.newInstance(clazz);
  }
892728
@SuppressWarnings("unchecked")
	public static <T> T newInstance(String clazz) throws UtilException {
		try {
			return (T) Class.forName(clazz).newInstance();
		} catch (Exception e) {
			throw new UtilException(e, "Instance class [{}] error!", clazz);
		}
	}