001// Generated by delombok at Sun Apr 14 14:59:49 CEST 2024
002/*
003 * Copyright (c) 2010-2024 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.types.features.HasComments;
030import com.restfb.types.features.HasCreatedTime;
031import com.restfb.types.features.HasProfilePicture;
032
033/**
034 * Represents the <a href="https://developers.facebook.com/docs/graph-api/reference/album/">Album Graph API type</a>.
035 * 
036 * @author <a href="http://restfb.com">Mark Allen</a>
037 * @since 1.5
038 */
039public class Album extends NamedFacebookType implements HasProfilePicture, HasComments, HasCreatedTime {
040  /**
041   * An object containing the ID and name of the profile who posted this album.
042   * 
043   */
044  @Facebook
045  private From from;
046  /**
047   * The description of the album.
048   * 
049   */
050  @Facebook
051  private String description;
052  /**
053   * The location of the album.
054   * 
055   */
056  @Facebook
057  private String location;
058  /**
059   * A link to this album on Facebook.
060   * 
061   */
062  @Facebook
063  private String link;
064  /**
065   * The number of photos in this album.
066   * 
067   */
068  @Facebook
069  private Long count;
070  /**
071   * The album cover photo ID.
072   * 
073   */
074  @Facebook("cover_photo")
075  private Photo coverPhoto;
076  @Facebook("cover_photo")
077  private String coverPhotoAsString;
078  /**
079   * The privacy settings for the album.
080   * 
081   */
082  @Facebook
083  private String privacy;
084  /**
085   * Whether or not the user has permission to upload to this album.
086   * 
087   */
088  @Facebook("can_upload")
089  private Boolean canUpload;
090  /**
091   * The time the photo album was initially created.
092   * 
093   */
094  @Facebook("created_time")
095  private Date createdTime;
096  /**
097   * The last time the photo album was updated.
098   * 
099   */
100  @Facebook("updated_time")
101  private Date updatedTime;
102  /**
103   * The place associated with this album.
104   *
105   */
106  @Facebook
107  private Place place;
108  /**
109   * The event associated with this album.
110   *
111   */
112  @Facebook
113  private Event event;
114  /**
115   * The comments for this album.
116   *
117   */
118  @Facebook
119  private Comments comments;
120  @Facebook("picture")
121  private transient String rawPicture;
122  /**
123   * The album's picture, if provided.
124   *
125   * To force Facebook to fill the <code>picture</code> field you have to fetch the album with the
126   * <code>fields=picture</code> parameter, otherwise the picture is <code>null</code>.
127   *
128   */
129  private ProfilePictureSource picture;
130  /**
131   * People who like this.
132   *
133   */
134  @Facebook
135  private Likes likes;
136  private static final long serialVersionUID = 1L;
137
138  @JsonMappingCompleted
139  protected void fillPicture(JsonMapper jsonMapper) {
140    picture = this.convertPicture(jsonMapper, rawPicture);
141  }
142
143  @JsonMappingCompleted
144  private void fillCoverPhoto() {
145    if (coverPhoto == null && coverPhotoAsString != null) {
146      coverPhoto = new Photo();
147      coverPhoto.setId(coverPhotoAsString);
148    }
149  }
150
151  /**
152   * An object containing the ID and name of the profile who posted this album.
153   * 
154   * @return An object containing the ID and name of the profile who posted this album.
155   */
156  @java.lang.SuppressWarnings("all")
157  public From getFrom() {
158    return this.from;
159  }
160
161  /**
162   * An object containing the ID and name of the profile who posted this album.
163   * 
164   */
165  @java.lang.SuppressWarnings("all")
166  public void setFrom(final From from) {
167    this.from = from;
168  }
169
170  /**
171   * The description of the album.
172   * 
173   * @return The description of the album.
174   */
175  @java.lang.SuppressWarnings("all")
176  public String getDescription() {
177    return this.description;
178  }
179
180  /**
181   * The description of the album.
182   * 
183   */
184  @java.lang.SuppressWarnings("all")
185  public void setDescription(final String description) {
186    this.description = description;
187  }
188
189  /**
190   * The location of the album.
191   * 
192   * @return The location of the album.
193   */
194  @java.lang.SuppressWarnings("all")
195  public String getLocation() {
196    return this.location;
197  }
198
199  /**
200   * The location of the album.
201   * 
202   */
203  @java.lang.SuppressWarnings("all")
204  public void setLocation(final String location) {
205    this.location = location;
206  }
207
208  /**
209   * A link to this album on Facebook.
210   * 
211   * @return A link to this album on Facebook.
212   */
213  @java.lang.SuppressWarnings("all")
214  public String getLink() {
215    return this.link;
216  }
217
218  /**
219   * A link to this album on Facebook.
220   * 
221   */
222  @java.lang.SuppressWarnings("all")
223  public void setLink(final String link) {
224    this.link = link;
225  }
226
227  /**
228   * The number of photos in this album.
229   * 
230   * @return The number of photos in this album.
231   */
232  @java.lang.SuppressWarnings("all")
233  public Long getCount() {
234    return this.count;
235  }
236
237  /**
238   * The number of photos in this album.
239   * 
240   */
241  @java.lang.SuppressWarnings("all")
242  public void setCount(final Long count) {
243    this.count = count;
244  }
245
246  /**
247   * The album cover photo ID.
248   * 
249   * @return The album cover photo ID
250   */
251  @java.lang.SuppressWarnings("all")
252  public Photo getCoverPhoto() {
253    return this.coverPhoto;
254  }
255
256  /**
257   * The album cover photo ID.
258   * 
259   */
260  @java.lang.SuppressWarnings("all")
261  public void setCoverPhoto(final Photo coverPhoto) {
262    this.coverPhoto = coverPhoto;
263  }
264
265  /**
266   * The privacy settings for the album.
267   * 
268   * @return The privacy settings for the album.
269   */
270  @java.lang.SuppressWarnings("all")
271  public String getPrivacy() {
272    return this.privacy;
273  }
274
275  /**
276   * The privacy settings for the album.
277   * 
278   */
279  @java.lang.SuppressWarnings("all")
280  public void setPrivacy(final String privacy) {
281    this.privacy = privacy;
282  }
283
284  /**
285   * Whether or not the user has permission to upload to this album.
286   * 
287   * @return The {@code can_upload} setting for this album.
288   */
289  @java.lang.SuppressWarnings("all")
290  public Boolean getCanUpload() {
291    return this.canUpload;
292  }
293
294  /**
295   * Whether or not the user has permission to upload to this album.
296   * 
297   */
298  @java.lang.SuppressWarnings("all")
299  public void setCanUpload(final Boolean canUpload) {
300    this.canUpload = canUpload;
301  }
302
303  /**
304   * The time the photo album was initially created.
305   * 
306   * @return The time the photo album was initially created.
307   */
308  @Override
309  @java.lang.SuppressWarnings("all")
310  public Date getCreatedTime() {
311    return this.createdTime;
312  }
313
314  /**
315   * The time the photo album was initially created.
316   * 
317   */
318  @java.lang.SuppressWarnings("all")
319  public void setCreatedTime(final Date createdTime) {
320    this.createdTime = createdTime;
321  }
322
323  /**
324   * The last time the photo album was updated.
325   * 
326   * @return The last time the photo album was updated.
327   */
328  @java.lang.SuppressWarnings("all")
329  public Date getUpdatedTime() {
330    return this.updatedTime;
331  }
332
333  /**
334   * The last time the photo album was updated.
335   * 
336   */
337  @java.lang.SuppressWarnings("all")
338  public void setUpdatedTime(final Date updatedTime) {
339    this.updatedTime = updatedTime;
340  }
341
342  /**
343   * The place associated with this album.
344   *
345   * @return The place associated with this album.
346   */
347  @java.lang.SuppressWarnings("all")
348  public Place getPlace() {
349    return this.place;
350  }
351
352  /**
353   * The place associated with this album.
354   *
355   */
356  @java.lang.SuppressWarnings("all")
357  public void setPlace(final Place place) {
358    this.place = place;
359  }
360
361  /**
362   * The event associated with this album.
363   *
364   * @return The event associated with this album.
365   */
366  @java.lang.SuppressWarnings("all")
367  public Event getEvent() {
368    return this.event;
369  }
370
371  /**
372   * The event associated with this album.
373   *
374   */
375  @java.lang.SuppressWarnings("all")
376  public void setEvent(final Event event) {
377    this.event = event;
378  }
379
380  /**
381   * The comments for this album.
382   *
383   * @return The comments for this album.
384   */
385  @Override
386  @java.lang.SuppressWarnings("all")
387  public Comments getComments() {
388    return this.comments;
389  }
390
391  /**
392   * The comments for this album.
393   *
394   */
395  @java.lang.SuppressWarnings("all")
396  public void setComments(final Comments comments) {
397    this.comments = comments;
398  }
399
400  /**
401   * The album's picture, if provided.
402   *
403   * To force Facebook to fill the <code>picture</code> field you have to fetch the album with the
404   * <code>fields=picture</code> parameter, otherwise the picture is <code>null</code>.
405   *
406   * @return the album's picture as ProfilePictureSource object
407   */
408  @Override
409  @java.lang.SuppressWarnings("all")
410  public ProfilePictureSource getPicture() {
411    return this.picture;
412  }
413
414  /**
415   * The album's picture, if provided.
416   *
417   * To force Facebook to fill the <code>picture</code> field you have to fetch the album with the
418   * <code>fields=picture</code> parameter, otherwise the picture is <code>null</code>.
419   *
420   */
421  @java.lang.SuppressWarnings("all")
422  public void setPicture(final ProfilePictureSource picture) {
423    this.picture = picture;
424  }
425
426  /**
427   * People who like this.
428   *
429   * @return The likes on this album.
430   */
431  @java.lang.SuppressWarnings("all")
432  public Likes getLikes() {
433    return this.likes;
434  }
435
436  /**
437   * People who like this.
438   *
439   */
440  @java.lang.SuppressWarnings("all")
441  public void setLikes(final Likes likes) {
442    this.likes = likes;
443  }
444}