View Javadoc
1   /**
2    * Copyright 2011-2012 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
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       * @return the title
86       */
87      public String getTitle() {
88          return title;
89      }
90  
91      /**
92       * @param title the title to set
93       */
94      public void setTitle(String title) {
95          this.title = title;
96      }
97  
98      /**
99       * @return the author
100      */
101     public String getAuthor() {
102         return author;
103     }
104 
105     /**
106      * @param author the author to set
107      */
108     public void setAuthor(String author) {
109         this.author = author;
110     }
111 
112     /**
113      * @return the description
114      */
115     public String getDescription() {
116         return description;
117     }
118 
119     /**
120      * @param description the description to set
121      */
122     public void setDescription(String description) {
123         this.description = description;
124     }
125 
126     /**
127      * @return the articles
128      */
129     public List<NewsArticleImpl> getArticles() {
130         return articles;
131     }
132 
133     /**
134      * @param articles the articles to set
135      */
136     public void setArticles(List<? extends NewsArticle> articles) {
137         this.articles = (List<NewsArticleImpl>)(List<?>)articles;
138     }
139 
140     /**
141      * @return the children
142      */
143     public List<NewsSourceImpl> getChildren() {
144         return children;
145     }
146 
147     /**
148      * @param children the children to set
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 }