zoukankan      html  css  js  c++  java
  • Realm 处理List<String> 问题 Type parameter 'java.lang.String' is not within its bound; should implement 'io.realm.RealmModel

    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;
        }
    }
    

      

  • 相关阅读:
    文件上传和下载
    代理模式
    设计模式分类
    单例模式
    抽象工厂模式
    成长
    Java教程
    python面试大全
    python入门教程
    收藏网摘
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/10207292.html
Copyright © 2011-2022 走看看