Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Feed.java « model « database « owncloudnewsreader « luhmer « de « java « main « src « News-Android-App - github.com/nextcloud/news-android.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7e0c7d4616f8e59e4c673d400a23bd41664265c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
package de.luhmer.owncloudnewsreader.database.model;

import java.util.List;

import de.greenrobot.dao.DaoException;

// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS

// KEEP INCLUDES - put your custom includes here
// KEEP INCLUDES END
/**
 * Entity mapped to table "FEED".
 */
public class Feed {

    private long id;
    private Long folderId;
    /** Not-null value. */
    private String feedTitle;
    private String faviconUrl;
    private String link;
    private String avgColour;
    private String notificationChannel;

    /** Used to resolve relations */
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    private transient FeedDao myDao;

    private Folder folder;
    private Long folder__resolvedKey;

    private List<RssItem> rssItemList;

    // KEEP FIELDS - put your custom fields here
    // KEEP FIELDS END

    public Feed() {
    }

    public Feed(long id) {
        this.id = id;
    }

    public Feed(long id, Long folderId, String feedTitle, String faviconUrl, String link, String avgColour, String notificationChannel) {
        this.id = id;
        this.folderId = folderId;
        this.feedTitle = feedTitle;
        this.faviconUrl = faviconUrl;
        this.link = link;
        this.avgColour = avgColour;
        this.notificationChannel = notificationChannel;
    }

    /** called by internal mechanisms, do not call yourself. */
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getFeedDao() : null;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public Long getFolderId() {
        return folderId;
    }

    public void setFolderId(Long folderId) {
        this.folderId = folderId;
    }

    /** Not-null value. */
    public String getFeedTitle() {
        return feedTitle;
    }

    /** Not-null value; ensure this value is available before it is saved to the database. */
    public void setFeedTitle(String feedTitle) {
        this.feedTitle = feedTitle;
    }

    public String getFaviconUrl() {
        return faviconUrl;
    }

    public void setFaviconUrl(String faviconUrl) {
        this.faviconUrl = faviconUrl;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getAvgColour() {
        return avgColour;
    }

    public void setAvgColour(String avgColour) {
        this.avgColour = avgColour;
    }

    public String getNotificationChannel() {
        return notificationChannel;
    }

    public void setNotificationChannel(String notificationChannel) {
        this.notificationChannel = notificationChannel;
    }

    /**
     * To-one relationship, resolved on first access.
     */
    public Folder getFolder() {
        Long __key = this.folderId;
        if (folder__resolvedKey == null || !folder__resolvedKey.equals(__key)) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            FolderDao targetDao = daoSession.getFolderDao();
            Folder folderNew = targetDao.load(__key);
            synchronized (this) {
                folder = folderNew;
            	folder__resolvedKey = __key;
            }
        }
        return folder;
    }

    public void setFolder(Folder folder) {
        synchronized (this) {
            this.folder = folder;
            folderId = folder == null ? null : folder.getId();
            folder__resolvedKey = folderId;
        }
    }

    /** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
    public List<RssItem> getRssItemList() {
        if (rssItemList == null) {
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            RssItemDao targetDao = daoSession.getRssItemDao();
            List<RssItem> rssItemListNew = targetDao._queryFeed_RssItemList(id);
            synchronized (this) {
                if(rssItemList == null) {
                    rssItemList = rssItemListNew;
                }
            }
        }
        return rssItemList;
    }

    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    public synchronized void resetRssItemList() {
        rssItemList = null;
    }

    /** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.delete(this);
    }

    /** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.update(this);
    }

    /** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }    
        myDao.refresh(this);
    }

    // KEEP METHODS - put your custom methods here
    // KEEP METHODS END

}