public static Class getPrimitiveClass(Class toClass)
    {
        if (isPrimitive(toClass))
        {
            return toClass;
        }

        if (toClass.equals(java.lang.Boolean.class))
        {
            return boolean.class;
        }
        else if (toClass.equals(java.lang.Byte.class))
        {
            return byte.class;
        }
        else if (toClass.equals(java.lang.Character.class))
        {
            return char.class;
        }
        else if (toClass.equals(java.lang.Double.class))
        {
            return double.class;
        }
        else if (toClass.equals(java.lang.Integer.class))
        {
            return int.class;
        }
        else if (toClass.equals(java.lang.Float.class))
        {
            return float.class;
        }
        else if (toClass.equals(java.lang.Long.class))
        {
            return long.class;
        }
        else if (toClass.equals(java.lang.Short.class))
        {
            return short.class;
        }
        return null;
    }