001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.dto.atom;
014
015import static org.apache.juneau.xml.annotation.XmlFormat.*;
016
017import java.util.*;
018
019import org.apache.juneau.annotation.*;
020import org.apache.juneau.internal.*;
021import org.apache.juneau.xml.annotation.*;
022
023/**
024 * Top-level ATOM feed object.
025 *
026 * <p>
027 * Represents an <c>atomFeed</c> construct in the RFC4287 specification.
028 *
029 * <h5 class='figure'>Schema</h5>
030 * <p class='bschema'>
031 *    atomFeed =
032 *       element atom:feed {
033 *          atomCommonAttributes,
034 *          (atomAuthor*
035 *           &amp; atomCategory*
036 *           &amp; atomContributor*
037 *           &amp; atomGenerator?
038 *           &amp; atomIcon?
039 *           &amp; atomId
040 *           &amp; atomLink*
041 *           &amp; atomLogo?
042 *           &amp; atomRights?
043 *           &amp; atomSubtitle?
044 *           &amp; atomTitle
045 *           &amp; atomUpdated
046 *           &amp; extensionElement*),
047 *          atomEntry*
048 *       }
049 * </p>
050 *
051 * <h5 class='section'>See Also:</h5><ul>
052 *    <li class='link'><a class="doclink" href="../../../../../index.html#jd.Atom">Overview &gt; juneau-dto &gt; Atom</a>
053 * </ul>
054 */
055@Bean(typeName="feed")
056@FluentSetters
057public class Feed extends CommonEntry {
058
059   private Generator generator;  // atomGenerator?
060   private Icon icon;            // atomIcon?
061   private Logo logo;            // atomLogo?
062   private Text subtitle;        // atomSubtitle?
063   private Entry[] entries;      // atomEntry*
064
065   /**
066    * Normal constructor.
067    *
068    * @param id The feed identifier.
069    * @param title The feed title.
070    * @param updated The feed updated timestamp.
071    */
072   public Feed(Id id, Text title, Calendar updated) {
073      super(id, title, updated);
074   }
075
076   /**
077    * Normal constructor.
078    *
079    * @param id The feed identifier.
080    * @param title The feed title.
081    * @param updated The feed updated timestamp.
082    */
083   public Feed(String id, String title, String updated) {
084      super(id, title, updated);
085   }
086
087   /** Bean constructor. */
088   public Feed() {}
089
090
091   //-----------------------------------------------------------------------------------------------------------------
092   // Bean properties
093   //-----------------------------------------------------------------------------------------------------------------
094
095   /**
096    * Bean property getter:  <property>generator</property>.
097    *
098    * <p>
099    * The generator information on this feed.
100    *
101    * @return The property value, or <jk>null</jk> if it is not set.
102    */
103   public Generator getGenerator() {
104      return generator;
105   }
106
107   /**
108    * Bean property setter:  <property>generator</property>.
109    *
110    * <p>
111    * The generator information on this feed.
112    *
113    * @param value
114    *    The new value for this property.
115    *    <br>Can be <jk>null</jk> to unset the property.
116    * @return This object
117    */
118   public Feed setGenerator(Generator value) {
119      this.generator = value;
120      return this;
121   }
122
123   /**
124    * Bean property getter:  <property>icon</property>.
125    *
126    * <p>
127    * The feed icon.
128    *
129    * @return The property value, or <jk>null</jk> if it is not set.
130    */
131   public Icon getIcon() {
132      return icon;
133   }
134
135   /**
136    * Bean property setter:  <property>icon</property>.
137    *
138    * <p>
139    * The feed icon.
140    *
141    * @param value
142    *    The new value for this property.
143    *    <br>Can be <jk>null</jk> to unset the property.
144    * @return This object
145    */
146   public Feed setIcon(Icon value) {
147      this.icon = value;
148      return this;
149   }
150
151   /**
152    * Bean property getter:  <property>logo</property>.
153    *
154    * <p>
155    * The feed logo.
156    *
157    * @return The property value, or <jk>null</jk> if it is not set.
158    */
159   public Logo getLogo() {
160      return logo;
161   }
162
163   /**
164    * Bean property setter:  <property>logo</property>.
165    *
166    * <p>
167    * The feed logo.
168    *
169    * @param value
170    *    The new value for this property.
171    *    <br>Can be <jk>null</jk> to unset the property.
172    * @return This object
173    */
174   public Feed setLogo(Logo value) {
175      this.logo = value;
176      return this;
177   }
178
179   /**
180    * Bean property getter:  <property>subtitle</property>.
181    *
182    * <p>
183    * The feed subtitle.
184    *
185    * @return The property value, or <jk>null</jk> if it is not set.
186    */
187   public Text getSubtitle() {
188      return subtitle;
189   }
190
191   /**
192    * Bean property setter:  <property>subtitle</property>.
193    *
194    * <p>
195    * The feed subtitle.
196    *
197    * @param value
198    *    The new value for this property.
199    *    <br>Can be <jk>null</jk> to unset the property.
200    * @return This object
201    */
202   public Feed setSubtitle(Text value) {
203      this.subtitle = value;
204      return this;
205   }
206
207   /**
208    * Bean property fluent setter:  <property>subtitle</property>.
209    *
210    * <p>
211    * The feed subtitle.
212    *
213    * @param value
214    *    The new value for this property.
215    *    <br>Can be <jk>null</jk> to unset the property.
216    * @return This object.
217    */
218   public Feed setSubtitle(String value) {
219      setSubtitle(new Text(value));
220      return this;
221   }
222
223   /**
224    * Bean property getter:  <property>entries</property>.
225    *
226    * <p>
227    * The entries in the feed.
228    *
229    * @return The property value, or <jk>null</jk> if it is not set.
230    */
231   @Xml(format=COLLAPSED)
232   public Entry[] getEntries() {
233      return entries;
234   }
235
236   /**
237    * Bean property setter:  <property>entries</property>.
238    *
239    * <p>
240    * The entries in the feed.
241    *
242    * @param value
243    *    The new value for this property.
244    *    <br>Can be <jk>null</jk> to unset the property.
245    * @return This object
246    */
247   public Feed setEntries(Entry...value) {
248      this.entries = value;
249      return this;
250   }
251
252   //-----------------------------------------------------------------------------------------------------------------
253   // Overridden setters (to simplify method chaining)
254   //-----------------------------------------------------------------------------------------------------------------
255
256   // <FluentSetters>
257
258   @Override /* GENERATED - org.apache.juneau.dto.atom.Common */
259   public Feed setBase(Object value) {
260      super.setBase(value);
261      return this;
262   }
263
264   @Override /* GENERATED - org.apache.juneau.dto.atom.Common */
265   public Feed setLang(String value) {
266      super.setLang(value);
267      return this;
268   }
269
270   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
271   public Feed setAuthors(Person...value) {
272      super.setAuthors(value);
273      return this;
274   }
275
276   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
277   public Feed setCategories(Category...value) {
278      super.setCategories(value);
279      return this;
280   }
281
282   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
283   public Feed setContributors(Person...value) {
284      super.setContributors(value);
285      return this;
286   }
287
288   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
289   public Feed setId(String value) {
290      super.setId(value);
291      return this;
292   }
293
294   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
295   public Feed setId(Id value) {
296      super.setId(value);
297      return this;
298   }
299
300   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
301   public Feed setLinks(Link...value) {
302      super.setLinks(value);
303      return this;
304   }
305
306   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
307   public Feed setRights(String value) {
308      super.setRights(value);
309      return this;
310   }
311
312   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
313   public Feed setRights(Text value) {
314      super.setRights(value);
315      return this;
316   }
317
318   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
319   public Feed setTitle(String value) {
320      super.setTitle(value);
321      return this;
322   }
323
324   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
325   public Feed setTitle(Text value) {
326      super.setTitle(value);
327      return this;
328   }
329
330   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
331   public Feed setUpdated(String value) {
332      super.setUpdated(value);
333      return this;
334   }
335
336   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
337   public Feed setUpdated(Calendar value) {
338      super.setUpdated(value);
339      return this;
340   }
341
342   // </FluentSetters>
343}