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.dto.atom.Utils.*;
016
017import java.util.*;
018
019import org.apache.juneau.annotation.*;
020import org.apache.juneau.internal.*;
021
022/**
023 * Represents an <c>atomEntry</c> construct in the RFC4287 specification.
024 *
025 * <h5 class='figure'>Schema</h5>
026 * <p class='bschema'>
027 *    atomEntry =
028 *       element atom:entry {
029 *          atomCommonAttributes,
030 *          (atomAuthor*
031 *          &amp; atomCategory*
032 *          &amp; atomContent?
033 *          &amp; atomContributor*
034 *          &amp; atomId
035 *          &amp; atomLink*
036 *          &amp; atomPublished?
037 *          &amp; atomRights?
038 *          &amp; atomSource?
039 *          &amp; atomSummary?
040 *          &amp; atomTitle
041 *          &amp; atomUpdated
042 *          &amp; extensionElement*)
043 *       }
044 * </p>
045 *
046 * <h5 class='section'>See Also:</h5><ul>
047 *    <li class='link'><a class="doclink" href="../../../../../index.html#jd.Atom">Overview &gt; juneau-dto &gt; Atom</a>
048 * </ul>
049 */
050@Bean(typeName="entry")
051@FluentSetters
052public class Entry extends CommonEntry {
053
054   private Content content;
055   private Calendar published;
056   private Source source;
057   private Text summary;
058
059   /**
060    * Normal constructor.
061    *
062    * @param id The ID of this entry.
063    * @param title The title of this entry.
064    * @param updated The updated timestamp of this entry.
065    */
066   public Entry(Id id, Text title, Calendar updated) {
067      super(id, title, updated);
068   }
069
070   /**
071    * Normal constructor.
072    *
073    * @param id The ID of this entry.
074    * @param title The title of this entry.
075    * @param updated The updated timestamp of this entry.
076    */
077   public Entry(String id, String title, String updated) {
078      super(id, title, updated);
079   }
080
081   /** Bean constructor. */
082   public Entry() {}
083
084
085   //-----------------------------------------------------------------------------------------------------------------
086   // Bean properties
087   //-----------------------------------------------------------------------------------------------------------------
088
089   /**
090    * Bean property getter:  <property>content</property>.
091    *
092    * <p>
093    * The content of this entry.
094    *
095    * @return The property value, or <jk>null</jk> if it is not set.
096    */
097   public Content getContent() {
098      return content;
099   }
100
101   /**
102    * Bean property setter:  <property>content</property>.
103    *
104    * <p>
105    * The content of this entry.
106    *
107    * @param value
108    *    The new value for this property.
109    *    <br>Can be <jk>null</jk> to unset the property.
110    * @return This object
111    */
112   public Entry setContent(Content value) {
113      this.content = value;
114      return this;
115   }
116
117   /**
118    * Bean property getter:  <property>published</property>.
119    *
120    * <p>
121    * The publish timestamp of this entry.
122    *
123    * @return The property value, or <jk>null</jk> if it is not set.
124    */
125   public Calendar getPublished() {
126      return published;
127   }
128
129   /**
130    * Bean property setter:  <property>published</property>.
131    *
132    * <p>
133    * The publish timestamp of this entry.
134    *
135    * @param value
136    *    The new value for this property.
137    *    <br>Can be <jk>null</jk> to unset the property.
138    * @return This object
139    */
140   public Entry setPublished(Calendar value) {
141      this.published = value;
142      return this;
143   }
144
145   /**
146    * Bean property fluent setter:  <property>published</property>.
147    *
148    * <p>
149    * The publish timestamp of this entry.
150    *
151    * @param value
152    *    The new value for this property.
153    *    <br>Can be <jk>null</jk> to unset the property.
154    * @return This object.
155    */
156   public Entry setPublished(String value) {
157      setPublished(parseDateTime(value));
158      return this;
159   }
160
161   /**
162    * Bean property getter:  <property>source</property>.
163    *
164    * <p>
165    * The source of this entry.
166    *
167    * @return The property value, or <jk>null</jk> if it is not set.
168    */
169   public Source getSource() {
170      return source;
171   }
172
173   /**
174    * Bean property setter:  <property>source</property>.
175    *
176    * <p>
177    * The source of this entry.
178    *
179    * @param value
180    *    The new value for this property.
181    *    <br>Can be <jk>null</jk> to unset the property.
182    * @return This object
183    */
184   public Entry setSource(Source value) {
185      this.source = value;
186      return this;
187   }
188
189   /**
190    * Bean property getter:  <property>summary</property>.
191    *
192    * <p>
193    * The summary of this entry.
194    *
195    * @return The property value, or <jk>null</jk> if it is not set.
196    */
197   public Text getSummary() {
198      return summary;
199   }
200
201   /**
202    * Bean property setter:  <property>summary</property>.
203    *
204    * <p>
205    * The summary of this entry.
206    *
207    * @param value
208    *    The new value for this property.
209    *    <br>Can be <jk>null</jk> to unset the property.
210    * @return This object
211    */
212   public Entry setSummary(Text value) {
213      this.summary = value;
214      return this;
215   }
216
217   /**
218    * Bean property fluent setter:  <property>summary</property>.
219    *
220    * <p>
221    * The summary of this entry.
222    *
223    * @param value
224    *    The new value for this property.
225    *    <br>Can be <jk>null</jk> to unset the property.
226    * @return This object.
227    */
228   public Entry setSummary(String value) {
229      setSummary(new Text(value));
230      return this;
231   }
232
233
234   //-----------------------------------------------------------------------------------------------------------------
235   // Overridden setters (to simplify method chaining)
236   //-----------------------------------------------------------------------------------------------------------------
237
238   // <FluentSetters>
239
240   @Override /* GENERATED - org.apache.juneau.dto.atom.Common */
241   public Entry setBase(Object value) {
242      super.setBase(value);
243      return this;
244   }
245
246   @Override /* GENERATED - org.apache.juneau.dto.atom.Common */
247   public Entry setLang(String value) {
248      super.setLang(value);
249      return this;
250   }
251
252   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
253   public Entry setAuthors(Person...value) {
254      super.setAuthors(value);
255      return this;
256   }
257
258   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
259   public Entry setCategories(Category...value) {
260      super.setCategories(value);
261      return this;
262   }
263
264   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
265   public Entry setContributors(Person...value) {
266      super.setContributors(value);
267      return this;
268   }
269
270   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
271   public Entry setId(String value) {
272      super.setId(value);
273      return this;
274   }
275
276   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
277   public Entry setId(Id value) {
278      super.setId(value);
279      return this;
280   }
281
282   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
283   public Entry setLinks(Link...value) {
284      super.setLinks(value);
285      return this;
286   }
287
288   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
289   public Entry setRights(String value) {
290      super.setRights(value);
291      return this;
292   }
293
294   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
295   public Entry setRights(Text value) {
296      super.setRights(value);
297      return this;
298   }
299
300   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
301   public Entry setTitle(String value) {
302      super.setTitle(value);
303      return this;
304   }
305
306   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
307   public Entry setTitle(Text value) {
308      super.setTitle(value);
309      return this;
310   }
311
312   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
313   public Entry setUpdated(String value) {
314      super.setUpdated(value);
315      return this;
316   }
317
318   @Override /* GENERATED - org.apache.juneau.dto.atom.CommonEntry */
319   public Entry setUpdated(Calendar value) {
320      super.setUpdated(value);
321      return this;
322   }
323
324   // </FluentSetters>
325}