1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.mobility.news.entity;
17
18 import javax.xml.bind.annotation.XmlElement;
19 import javax.xml.bind.annotation.XmlRootElement;
20 import javax.xml.bind.annotation.XmlSeeAlso;
21 import java.util.ArrayList;
22 import java.util.List;
23
24 @XmlRootElement( name="newsSource" )
25 @XmlSeeAlso({NewsArticleImpl.class})
26 public class NewsSourceImpl implements NewsSource {
27
28 private Long id;
29 private String name;
30 private String url;
31 private boolean active;
32 private int order;
33 private Long parentId;
34 private String title;
35 private String author;
36 private String description;
37 private boolean hasChildren;
38
39 public NewsSourceImpl() {
40 }
41
42 @XmlElement( name="articles" )
43 private List<NewsArticleImpl> articles;
44 @XmlElement( name="children" )
45 private List<NewsSourceImpl> children;
46
47 public Long getId() {
48 return id;
49 }
50 public void setId(Long id) {
51 this.id = id;
52 }
53 public String getName() {
54 return name;
55 }
56 public void setName(String name) {
57 this.name = name;
58 }
59 public String getUrl() {
60 return url;
61 }
62 public void setUrl(String url) {
63 this.url = url;
64 }
65 public boolean isActive() {
66 return active;
67 }
68 public void setActive(boolean active) {
69 this.active = active;
70 }
71 public int getOrder() {
72 return order;
73 }
74 public void setOrder(int order) {
75 this.order = order;
76 }
77 public Long getParentId() {
78 return parentId;
79 }
80 public void setParentId(Long parentId) {
81 this.parentId = parentId;
82 }
83
84
85
86
87 public String getTitle() {
88 return title;
89 }
90
91
92
93
94 public void setTitle(String title) {
95 this.title = title;
96 }
97
98
99
100
101 public String getAuthor() {
102 return author;
103 }
104
105
106
107
108 public void setAuthor(String author) {
109 this.author = author;
110 }
111
112
113
114
115 public String getDescription() {
116 return description;
117 }
118
119
120
121
122 public void setDescription(String description) {
123 this.description = description;
124 }
125
126
127
128
129 public List<NewsArticleImpl> getArticles() {
130 return articles;
131 }
132
133
134
135
136 public void setArticles(List<? extends NewsArticle> articles) {
137 this.articles = (List<NewsArticleImpl>)(List<?>)articles;
138 }
139
140
141
142
143 public List<NewsSourceImpl> getChildren() {
144 return children;
145 }
146
147
148
149
150 public void setChildren(List<? extends NewsSource> children) {
151 this.children = (List<NewsSourceImpl>)(List<?>)children;
152 }
153
154 public void addChild( NewsSource child ) {
155 if( null == children ) {
156 children = new ArrayList<NewsSourceImpl>();
157 }
158 children.add((NewsSourceImpl)child);
159 }
160
161 public boolean hasChildren() {
162 return hasChildren;
163 }
164
165 public void setHasChildren(boolean hasChildren) {
166 this.hasChildren = hasChildren;
167 }
168
169 }