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

      

  • 相关阅读:
    hdu 4947
    hdu 4946
    hdu 4944
    hdu 4942
    hdu 4941
    PAT 【L2-011 玩转二叉树】
    PAT【L2-006 树的遍历】
    XYNUOJ 【2070: 重建二叉树】
    XYNUOJ 【1367: 二叉链表存储的二叉树】
    XYNUOJ 2390【二叉树遍历2】
  • 原文地址:https://www.cnblogs.com/freexiaoyu/p/10207292.html
Copyright © 2020-2023  润新知