Realm 處理List 問題 Type parameter 'java.lang.String' is not within its bound; should implement

public class InitAppBean extends RealmObject {
    private String sapling;
    private String logistics;
    private RealmList<DeliverTypeListBean> deliverTypeList;
    private RealmList<RealmString> countryList;

    public String getSapling() {
        return sapling;
    }

    public void setSapling(String sapling) {
        this.sapling = sapling;
    }

    public String getLogistics() {
        return logistics;
    }

    public void setLogistics(String logistics) {
        this.logistics = logistics;
    }

    public List<DeliverTypeListBean> getDeliverTypeList() {
        return deliverTypeList;
    }

    public void setDeliverTypeList(RealmList<DeliverTypeListBean> deliverTypeList) {
        this.deliverTypeList = deliverTypeList;
    }

    public RealmList<RealmString> getCountryList() {
        return countryList;
    }

    public void setCountryList(RealmList<RealmString> countryList) {
        this.countryList = countryList;
    }

  新建立String類繼承RealmObjectjava

public class RealmString extends RealmObject {
    private String val;

    public String getValue() {
        return val;
    }

    public void setValue(String value) {
        this.val = value;
    }
}
相關文章
相關標籤/搜索