码迷,mamicode.com
首页 > 编程语言 > 详细

Realm 处理List<String> 问题 Type parameter 'java.lang.String' is not within its bound; should implement 'io.realm.RealmModel

时间:2019-01-02 12:53:06      阅读:693      评论:0      收藏:0      [点我收藏+]

标签:string   country   live   tco   vat   this   void   imp   ini   

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类继承RealmObject

public class RealmString extends RealmObject {
    private String val;

    public String getValue() {
        return val;
    }

    public void setValue(String value) {
        this.val = value;
    }
}

  

Realm 处理List<String> 问题 Type parameter 'java.lang.String' is not within its bound; should implement 'io.realm.RealmModel

标签:string   country   live   tco   vat   this   void   imp   ini   

原文地址:https://www.cnblogs.com/freexiaoyu/p/10207292.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!