Java Utililty Methods Char Array Create

List of utility methods to do Char Array Create

Description

The list of methods to do Char Array Create are organized into topic(s).

Method

Class[]toClassArray(String[] classNames)
Converts the given list of class names to a list of classes.
if (classNames == null)
    return null;
Class<?>[] classes = new Class<?>[classNames.length];
for (int i = 0; i < classes.length; i++) {
    classes[i] = Class.forName(classNames[i]);
return classes;
Class[]toClasses(ClassLoader classLoader, String[] argClassNames)
to Classes
Class<?>[] result = new Class[argClassNames.length];
for (int i = 0; i < argClassNames.length; i++) {
    String argClassName = argClassNames[i];
    try {
        result[i] = Class.forName(argClassName, true, classLoader);
    } catch (ClassNotFoundException e) {
        throw new IllegalArgumentException("No such class name : " + argClassName, e);
return result;
Class[]toClasses(final Object... parameters)
to Classes
if (parameters == null || parameters.length == 0) {
    return new Class[0];
final Class[] parameterTypes = new Class[parameters.length];
for (int i = parameters.length - 1; i >= 0; i--) {
    if (parameters[i] == null) {
        parameterTypes[i] = null;
    } else {
...
Class[]toClasses(Object[] args)
From a list of objects, extracts a list of corresponding classes.
if (args.length <= 0)
    return new Class[0];
Class[] value = new Class[args.length];
int iter = 0;
for (Object A : args) {
    value[iter] = A.getClass();
    iter++;
return value;
Class[]toClasses(Object[] objs)
to Classes
Class[] classes;
if (objs == null) {
    classes = new Class[] {};
} else if (objs instanceof Class[]) {
    classes = (Class[]) objs;
} else if (objs instanceof String[]) {
    classes = forNames((String[]) objs);
} else {
...
Class[]toClassesFromObjects(final Object[] params)
To classes from objects.
final Class<?>[] classes = new Class<?>[params.length];
int i = 0;
for (final Object object : params) {
    if (object != null) {
        classes[i++] = object.getClass();
    } else {
        classes[i++] = Object.class;
return classes;