All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.kickstart.tools.util.Primitives Maven / Gradle / Ivy

There is a newer version: 14.0.0
Show newest version
package graphql.kickstart.tools.util;

public final class Primitives {

    @SuppressWarnings("unchecked")
    public static  Class wrap(Class type) {
        if (boolean.class.equals(type)) {
            return (Class) Boolean.class;
        } else if (byte.class.equals(type)) {
            return (Class) Byte.class;
        } else if (char.class.equals(type)) {
            return (Class) Character.class;
        } else if (double.class.equals(type)) {
            return (Class) Double.class;
        } else if (float.class.equals(type)) {
            return (Class) Float.class;
        } else if (int.class.equals(type)) {
            return (Class) Integer.class;
        } else if (long.class.equals(type)) {
            return (Class) Long.class;
        } else if (short.class.equals(type)) {
            return (Class) Short.class;
        } else if (void.class.equals(type)) {
            return (Class) Void.class;
        } else {
            return type;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy