private int getType(Object a) {

        while (a.getClass().isArray()) {
            a = Array.get(a, 0);
        }

        if (a instanceof Byte) {
            return 1;
        }

        if (a instanceof Boolean) {
            return 2;
        }

        if (a instanceof Short) {
            return 3;
        }

        if (a instanceof Integer) {
            return 5;
        }

        if (a instanceof Long) {
            return 7;
        }

        if (a instanceof Float) {
            return 9;
        }

        if (a instanceof Double) {
            return 10;
        }

        if (a instanceof String) {
            return 11;
        }

        return -1;
    }