Android 改型2.2.0从响应中获取特定字段,而不是绑定到对象

Android 改型2.2.0从响应中获取特定字段,而不是绑定到对象,android,retrofit2,Android,Retrofit2,在android客户端上,我正在对HTTP请求进行改造,但GET方法有问题;如何获取用户的特定字段,例如,我想将用户名存储到变量name=response.getUserName()由于某种原因,接口总是返回null //This the API GET @GET("api/user") Call<List<Users>> listUsers(); //This is the restClient /** * Getting all the users from t

在android客户端上,我正在对HTTP请求进行改造,但GET方法有问题;如何获取用户的特定字段,例如,我想将用户名存储到变量
name=response.getUserName()由于某种原因,接口总是返回null

 //This the API GET
@GET("api/user")
Call<List<Users>> listUsers();

//This is the restClient
/**
 * Getting all the users from the
 * REST API and mongoDB
 * @return
 */
public List<Users> getUsers(){
    Call<List<Users>> userList = service.listUsers();
    userList.enqueue(new Callback<List<Users>>() {
        @Override
        public void onResponse(Call<List<Users>> call, Response<List<Users>> response) {

            /**
             * The is isSuccessful method find out
             * if the status code is in the range 200-300,
             * indicating success.
             */
            if(response.isSuccessful()){
                users = response.body();                     
                callback.resultReady(users);
            }
        }

//Here is the callbackInterface
public interface ResulReadyCallBack {
public void resultReady(List<Users> users);
//这是API得到的
@获取(“api/用户”)
调用listUsers();
//这是restClient
/**
*将所有用户从
*RESTAPI和mongoDB
*@返回
*/
公共列表getUsers(){
Call userList=service.listUsers();
enqueue(新回调(){
@凌驾
公共void onResponse(调用、响应){
/**
*找到问题的方法是成功的
*如果状态代码在200-300范围内,
*表示成功。
*/
if(response.issusccessful()){
users=response.body();
callback.resultrady(用户);
}
}
//这是回调接口
公共接口ResultReadyCallback{
公共作废结果(列出用户);

}

这是什么意思?“接口总是因为某些原因现在返回”其输入错误我的意思是接口因为某些原因返回null!callback.resultraday(users);=>回调为null。