graphql.kickstart.tools.util.Primitives Maven / Gradle / Ivy
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;
}
}
}