Java通用数组Jsonify

Java通用数组Jsonify,java,arrays,generics,gson,Java,Arrays,Generics,Gson,我的对象中有以下属性: List<? extends IRespondentCompressed> attr; list能否显示将这些RespondentCompressed对象分配到列表中的部分?为什么要使用list?您可以显示将这些RespondentCompressed对象分配到列表中的部分吗?为什么要使用列表 public class RespondentCompressed implements IRespondentCompressed { @Serializ

我的对象中有以下属性:

List<? extends IRespondentCompressed> attr;

list能否显示将这些
RespondentCompressed
对象分配到列表中的部分?为什么要使用
list?您可以显示将这些
RespondentCompressed
对象分配到列表中的部分吗?为什么要使用
列表
public class RespondentCompressed implements IRespondentCompressed {

    @SerializedName(value="id")
    private int Id;

    @SerializedName(value="inserted_local_time")
    private String InsertedLocalTime;

    @SerializedName(value="responses", alternate={"Answers"})
    List<IResponse> Answers = new ArrayList<>();

    @Override
    public int getId() {
        return this.Id;
    }

    @Override
    public void setId(int Id) {

    }

    @Override
    public String getLocalInsertedTime() {
        return this.InsertedLocalTime;
    }

    @Override
    public void setLocalInsertedTime(String localInsertedTime) {

    }

    @Override
    public void setResponses(List<IResponse> ans) {
        this.Answers = ans;
    }

    @Override
    public List<IResponse> getResponses() {
        return this.Answers;
    }
}