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