001// Generated by delombok at Fri Nov 22 22:30:55 CET 2019
002/**
003 * Copyright (c) 2010-2019 Mark Allen, Norbert Bartels.
004 *
005 * Permission is hereby granted, free of charge, to any person obtaining a copy
006 * of this software and associated documentation files (the "Software"), to deal
007 * in the Software without restriction, including without limitation the rights
008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009 * copies of the Software, and to permit persons to whom the Software is
010 * furnished to do so, subject to the following conditions:
011 *
012 * The above copyright notice and this permission notice shall be included in
013 * all copies or substantial portions of the Software.
014 *
015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021 * THE SOFTWARE.
022 */
023package com.restfb.types;
024
025import java.util.Date;
026import com.restfb.Facebook;
027import com.restfb.JsonMapper;
028import com.restfb.JsonMapper.JsonMappingCompleted;
029import com.restfb.util.MappingUtils;
030
031/**
032 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/album/">Album Graph API type</a>.
033 * 
034 * @author <a href="http://restfb.com">Mark Allen</a>
035 * @since 1.5
036 */
037public class Album extends NamedFacebookType {
038  /**
039   * An object containing the ID and name of the profile who posted this album.
040   */
041  @Facebook
042  private CategorizedFacebookType from;
043  /**
044   * The description of the album.
045   */
046  @Facebook
047  private String description;
048  /**
049   * The location of the album.
050   */
051  @Facebook
052  private String location;
053  /**
054   * A link to this album on Facebook.
055   */
056  @Facebook
057  private String link;
058  /**
059   * The number of photos in this album.
060   */
061  @Facebook
062  private Long count;
063  /**
064   * The album cover photo ID.
065   */
066  @Facebook("cover_photo")
067  private Photo coverPhoto;
068  @Facebook("cover_photo")
069  private String coverPhotoAsString;
070  /**
071   * The privacy settings for the album.
072   */
073  @Facebook
074  private String privacy;
075  /**
076   * Whether or not the user has permission to upload to this album.
077   */
078  @Facebook("can_upload")
079  private Boolean canUpload;
080  /**
081   * The time the photo album was initially created.
082   */
083  @Facebook("created_time")
084  private Date createdTime;
085  /**
086   * The last time the photo album was updated.
087   */
088  @Facebook("updated_time")
089  private Date updatedTime;
090  /**
091   * The place associated with this album.
092   */
093  @Facebook
094  private Place place;
095  /**
096   * The event associated with this album.
097   */
098  @Facebook
099  private Event event;
100  /**
101   * The comments for this album.
102   */
103  @Facebook
104  private Comments comments;
105  @Facebook("picture")
106  private transient String rawPicture;
107  /**
108   * The album's picture, if provided.
109   *
110   * To force Facebook to fill the <code>picture</code> field you have to fetch the album with the
111   * <code>fields=picture</code> parameter, otherwise the picture is <code>null</code>.
112   */
113  private ProfilePictureSource picture;
114  /**
115   * People who like this.
116   */
117  @Facebook
118  private Likes likes;
119  private static final long serialVersionUID = 1L;
120
121  @JsonMappingCompleted
122  protected void fillPicture(JsonMapper jsonMapper) {
123    MappingUtils mappingUtils = new MappingUtils(jsonMapper);
124    picture = mappingUtils.convertPicture(rawPicture);
125  }
126
127  @JsonMappingCompleted
128  private void fillCoverPhoto() {
129    if (coverPhoto == null && coverPhotoAsString != null) {
130      coverPhoto = new Photo();
131      coverPhoto.setId(coverPhotoAsString);
132    }
133  }
134
135  /**
136   * An object containing the ID and name of the profile who posted this album.
137   * 
138   * @return An object containing the ID and name of the profile who posted this album.
139   */
140  @java.lang.SuppressWarnings("all")
141  public CategorizedFacebookType getFrom() {
142    return this.from;
143  }
144
145  /**
146   * An object containing the ID and name of the profile who posted this album.
147   */
148  @java.lang.SuppressWarnings("all")
149  public void setFrom(final CategorizedFacebookType from) {
150    this.from = from;
151  }
152
153  /**
154   * The description of the album.
155   * 
156   * @return The description of the album.
157   */
158  @java.lang.SuppressWarnings("all")
159  public String getDescription() {
160    return this.description;
161  }
162
163  /**
164   * The description of the album.
165   */
166  @java.lang.SuppressWarnings("all")
167  public void setDescription(final String description) {
168    this.description = description;
169  }
170
171  /**
172   * The location of the album.
173   * 
174   * @return The location of the album.
175   */
176  @java.lang.SuppressWarnings("all")
177  public String getLocation() {
178    return this.location;
179  }
180
181  /**
182   * The location of the album.
183   */
184  @java.lang.SuppressWarnings("all")
185  public void setLocation(final String location) {
186    this.location = location;
187  }
188
189  /**
190   * A link to this album on Facebook.
191   * 
192   * @return A link to this album on Facebook.
193   */
194  @java.lang.SuppressWarnings("all")
195  public String getLink() {
196    return this.link;
197  }
198
199  /**
200   * A link to this album on Facebook.
201   */
202  @java.lang.SuppressWarnings("all")
203  public void setLink(final String link) {
204    this.link = link;
205  }
206
207  /**
208   * The number of photos in this album.
209   * 
210   * @return The number of photos in this album.
211   */
212  @java.lang.SuppressWarnings("all")
213  public Long getCount() {
214    return this.count;
215  }
216
217  /**
218   * The number of photos in this album.
219   */
220  @java.lang.SuppressWarnings("all")
221  public void setCount(final Long count) {
222    this.count = count;
223  }
224
225  /**
226   * The album cover photo ID.
227   * 
228   * @return The album cover photo ID
229   */
230  @java.lang.SuppressWarnings("all")
231  public Photo getCoverPhoto() {
232    return this.coverPhoto;
233  }
234
235  /**
236   * The album cover photo ID.
237   */
238  @java.lang.SuppressWarnings("all")
239  public void setCoverPhoto(final Photo coverPhoto) {
240    this.coverPhoto = coverPhoto;
241  }
242
243  /**
244   * The privacy settings for the album.
245   * 
246   * @return The privacy settings for the album.
247   */
248  @java.lang.SuppressWarnings("all")
249  public String getPrivacy() {
250    return this.privacy;
251  }
252
253  /**
254   * The privacy settings for the album.
255   */
256  @java.lang.SuppressWarnings("all")
257  public void setPrivacy(final String privacy) {
258    this.privacy = privacy;
259  }
260
261  /**
262   * Whether or not the user has permission to upload to this album.
263   * 
264   * @return The {@code can_upload} setting for this album.
265   */
266  @java.lang.SuppressWarnings("all")
267  public Boolean getCanUpload() {
268    return this.canUpload;
269  }
270
271  /**
272   * Whether or not the user has permission to upload to this album.
273   */
274  @java.lang.SuppressWarnings("all")
275  public void setCanUpload(final Boolean canUpload) {
276    this.canUpload = canUpload;
277  }
278
279  /**
280   * The time the photo album was initially created.
281   * 
282   * @return The time the photo album was initially created.
283   */
284  @java.lang.SuppressWarnings("all")
285  public Date getCreatedTime() {
286    return this.createdTime;
287  }
288
289  /**
290   * The time the photo album was initially created.
291   */
292  @java.lang.SuppressWarnings("all")
293  public void setCreatedTime(final Date createdTime) {
294    this.createdTime = createdTime;
295  }
296
297  /**
298   * The last time the photo album was updated.
299   * 
300   * @return The last time the photo album was updated.
301   */
302  @java.lang.SuppressWarnings("all")
303  public Date getUpdatedTime() {
304    return this.updatedTime;
305  }
306
307  /**
308   * The last time the photo album was updated.
309   */
310  @java.lang.SuppressWarnings("all")
311  public void setUpdatedTime(final Date updatedTime) {
312    this.updatedTime = updatedTime;
313  }
314
315  /**
316   * The place associated with this album.
317   *
318   * @return The place associated with this album.
319   */
320  @java.lang.SuppressWarnings("all")
321  public Place getPlace() {
322    return this.place;
323  }
324
325  /**
326   * The place associated with this album.
327   */
328  @java.lang.SuppressWarnings("all")
329  public void setPlace(final Place place) {
330    this.place = place;
331  }
332
333  /**
334   * The event associated with this album.
335   *
336   * @return The event associated with this album.
337   */
338  @java.lang.SuppressWarnings("all")
339  public Event getEvent() {
340    return this.event;
341  }
342
343  /**
344   * The event associated with this album.
345   */
346  @java.lang.SuppressWarnings("all")
347  public void setEvent(final Event event) {
348    this.event = event;
349  }
350
351  /**
352   * The comments for this album.
353   *
354   * @return The comments for this album.
355   */
356  @java.lang.SuppressWarnings("all")
357  public Comments getComments() {
358    return this.comments;
359  }
360
361  /**
362   * The comments for this album.
363   */
364  @java.lang.SuppressWarnings("all")
365  public void setComments(final Comments comments) {
366    this.comments = comments;
367  }
368
369  /**
370   * The album's picture, if provided.
371   *
372   * To force Facebook to fill the <code>picture</code> field you have to fetch the album with the
373   * <code>fields=picture</code> parameter, otherwise the picture is <code>null</code>.
374   *
375   * @return the album's picture as ProfilePictureSource object
376   */
377  @java.lang.SuppressWarnings("all")
378  public ProfilePictureSource getPicture() {
379    return this.picture;
380  }
381
382  /**
383   * The album's picture, if provided.
384   *
385   * To force Facebook to fill the <code>picture</code> field you have to fetch the album with the
386   * <code>fields=picture</code> parameter, otherwise the picture is <code>null</code>.
387   */
388  @java.lang.SuppressWarnings("all")
389  public void setPicture(final ProfilePictureSource picture) {
390    this.picture = picture;
391  }
392
393  /**
394   * People who like this.
395   *
396   * @return The likes on this album.
397   */
398  @java.lang.SuppressWarnings("all")
399  public Likes getLikes() {
400    return this.likes;
401  }
402
403  /**
404   * People who like this.
405   */
406  @java.lang.SuppressWarnings("all")
407  public void setLikes(final Likes likes) {
408    this.likes = likes;
409  }
410}