封装OkHttp的时候遇到操作问题。。

今天在封装一个OkHttp的时候,看的代码,写入的。

下面是报错的情况

img

下面是HttpUtils里面的代码

 //postDefault
    public static <T extends BaseBean> void postDefault(HttpInterface httpInterface, String httpUrl, MapUtils mapUtils,
                                                        Class<T> mClass, @NonNull OKHttpListener<T> listener) {
        if (mapUtils.get(KEY_USERID) == null) {
            mapUtils.put(KEY_USERID, "用户id");
        }
        postCustom(httpInterface, httpUrl, RequestBody.create(mMediaType, mapUtils.toString()), null, mClass, listener);
    }

img

下面是HttpUtils里面的代码段

//postDefault
    public static <T extends BaseBean> void postDefault(HttpInterface httpInterface, String httpUrl, MapUtils mapUtils,
                                                        Class<T> mClass, @NonNull OKHttpListener<T> listener) {
        if (mapUtils.get(KEY_USERID) == null) {
            mapUtils.put(KEY_USERID, "用户id");
        }
        postCustom(httpInterface, httpUrl, RequestBody.create(mMediaType, mapUtils.toString()), null, mClass, listener);
    }

这个在Class里面怎么调用呀?也不能用this

ClassName.this

可以采用反射机制