001// Generated by delombok at Sun Jul 07 22:01:31 CEST 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 static com.restfb.util.StringUtils.isBlank;
026import java.util.ArrayList;
027import java.util.Collections;
028import java.util.List;
029import com.restfb.Facebook;
030
031/**
032 * Base class which encapsulates behavior and properties common to most
033 * <a href="http://developers.facebook.com/docs/reference/api/">Graph API types</a>.
034 * 
035 * @author <a href="http://restfb.com">Mark Allen</a>
036 * @since 1.5
037 */
038public class FacebookType extends AbstractFacebookType {
039  /**
040   * This object's unique Facebook ID.
041   */
042  @Facebook
043  private String id;
044  /**
045   * This object's metadata, available by including the {@code metadata=1} URL parameter in an API request.
046   */
047  @Facebook
048  private Metadata metadata;
049  @Facebook
050  private String type;
051  private static final long serialVersionUID = 1L;
052
053
054  /**
055   * Represents <a href="http://developers.facebook.com/docs/api#introspection">Facebook Object metadata</a>, available
056   * by including the {@code metadata=1} URL parameter in an API request.
057   * 
058   * @author <a href="http://restfb.com">Mark Allen</a>
059   * @since 1.5
060   */
061  public static class Metadata extends AbstractFacebookType {
062    /**
063     * The available connections for this object.
064     * -- GETTER --
065     * @return The available connections for this object.
066     */
067    @Facebook
068    private Connections connections;
069    /**
070     * The metadata type of the object
071     * -- GETTER --
072     * @return the metadata type
073     * @since 1.6.16
074     */
075    @Facebook
076    private String type;
077    @Facebook
078    private List<NamedFacebookType> fields = new ArrayList<>();
079    private static final long serialVersionUID = 1L;
080
081    /**
082     * Represents <a href="http://developers.facebook.com/docs/api#introspection">Facebook Object connections
083     * metadata</a>, available by including the {@code metadata=1} URL parameter in an API request.
084     * 
085     * @author <a href="http://restfb.com">Mark Allen</a>
086     * @since 1.5
087     */
088    public static class Connections extends AbstractFacebookType {
089      /**
090       * This object's 'home' connection URL.
091       * -- GETTER --
092       * @return This object's 'home' connection URL, or {@code null} if it doesn't have one.
093       */
094      @Facebook
095      private String home;
096      /**
097       * This object's 'feed' connection URL.
098       * -- GETTER --
099       * @return This object's 'feed' connection URL, or {@code null} if it doesn't have one.
100       */
101      @Facebook
102      private String feed;
103      /**
104       * This object's 'friends' connection URL.
105       * -- GETTER --
106       * @return This object's 'friends' connection URL, or {@code null} if it doesn't have one.
107       */
108      @Facebook
109      private String friends;
110      /**
111       * This object's 'family' connection URL.
112       * -- GETTER --
113       * @return This object's 'family' connection URL, or {@code null} if it doesn't have one.
114       */
115      @Facebook
116      private String family;
117      /**
118       * This object's 'activities' connection URL.
119       * -- GETTER --
120       * @return This object's 'activities' connection URL, or {@code null} if it doesn't have one.
121       */
122      @Facebook
123      private String activities;
124      /**
125       * This object's 'interests' connection URL.
126       * -- GETTER --
127       * @return This object's 'interests' connection URL, or {@code null} if it doesn't have one.
128       */
129      @Facebook
130      private String interests;
131      /**
132       * This object's 'music' connection URL.
133       * -- GETTER --
134       * @return This object's 'music' connection URL, or {@code null} if it doesn't have one.
135       */
136      @Facebook
137      private String music;
138      /**
139       * This object's 'books' connection URL.
140       * -- GETTER --
141       * @return This object's 'books' connection URL, or {@code null} if it doesn't have one.
142       */
143      @Facebook
144      private String books;
145      /**
146       * This object's 'movies' connection URL.
147       * -- GETTER --
148       * @return This object's 'movies' connection URL, or {@code null} if it doesn't have one.
149       */
150      @Facebook
151      private String movies;
152      /**
153       * This object's 'television' connection URL.
154       * -- GETTER --
155       * @return This object's 'television' connection URL, or {@code null} if it doesn't have one.
156       */
157      @Facebook
158      private String television;
159      /**
160       * This object's 'likes' connection URL.
161       * -- GETTER --
162       * @return This object's 'likes' connection URL, or {@code null} if it doesn't have one.
163       */
164      @Facebook
165      private String likes;
166      /**
167       * This object's 'posts' connection URL.
168       * -- GETTER --
169       * @return This object's 'posts' connection URL, or {@code null} if it doesn't have one.
170       */
171      @Facebook
172      private String posts;
173      /**
174       * This object's 'tagged' connection URL.
175       * -- GETTER --
176       * @return This object's 'tagged' connection URL, or {@code null} if it doesn't have one.
177       */
178      @Facebook
179      private String tagged;
180      /**
181       * This object's 'statuses' connection URL.
182       * -- GETTER --
183       * @return This object's 'statuses' connection URL, or {@code null} if it doesn't have one.
184       */
185      @Facebook
186      private String statuses;
187      /**
188       * This object's 'links' connection URL.
189       * -- GETTER --
190       * @return This object's 'links' connection URL, or {@code null} if it doesn't have one.
191       */
192      @Facebook
193      private String links;
194      /**
195       * This object's 'notes' connection URL.
196       * -- GETTER --
197       * @return This object's 'notes' connection URL, or {@code null} if it doesn't have one.
198       */
199      @Facebook
200      private String notes;
201      /**
202       * This object's 'photos' connection URL.
203       * -- GETTER --
204       * @return This object's 'photos' connection URL, or {@code null} if it doesn't have one.
205       */
206      @Facebook
207      private String photos;
208      /**
209       * This object's 'albums' connection URL.
210       * -- GETTER --
211       * @return This object's 'albums' connection URL, or {@code null} if it doesn't have one.
212       */
213      @Facebook
214      private String albums;
215      /**
216       * This object's 'events' connection URL.
217       * -- GETTER --
218       * @return This object's 'events' connection URL, or {@code null} if it doesn't have one.
219       */
220      @Facebook
221      private String events;
222      /**
223       * This object's 'groups' connection URL.
224       * -- GETTER --
225       * @return This object's 'groups' connection URL, or {@code null} if it doesn't have one.
226       */
227      @Facebook
228      private String groups;
229      /**
230       * This object's 'videos' connection URL.
231       * -- GETTER --
232       * @return This object's 'videos' connection URL, or {@code null} if it doesn't have one.
233       */
234      @Facebook
235      private String videos;
236      /**
237       * This object's 'picture' connection URL.
238       * -- GETTER --
239       * @return This object's 'picture' connection URL, or {@code null} if it doesn't have one.
240       */
241      @Facebook
242      private String picture;
243      /**
244       * This object's 'inbox' connection URL.
245       * -- GETTER --
246       * @return This object's 'inbox' connection URL, or {@code null} if it doesn't have one.
247       */
248      @Facebook
249      private String inbox;
250      /**
251       * This object's 'outbox' connection URL.
252       * -- GETTER --
253       * @return This object's 'outbox' connection URL, or {@code null} if it doesn't have one.
254       */
255      @Facebook
256      private String outbox;
257      /**
258       * This object's 'updates' connection URL.
259       * -- GETTER --
260       * @return This object's 'updates' connection URL, or {@code null} if it doesn't have one.
261       */
262      @Facebook
263      private String updates;
264      private static final long serialVersionUID = 1L;
265
266      /**
267       * Does this object have a 'home' connection?
268       * 
269       * @return {@code true} if this object has a 'home' connection, {@code false} otherwise.
270       */
271      public Boolean hasHome() {
272        return !isBlank(home);
273      }
274
275      /**
276       * Does this object have a 'feed' connection?
277       * 
278       * @return {@code true} if this object has a 'feed' connection, {@code false} otherwise.
279       */
280      public Boolean hasFeed() {
281        return !isBlank(feed);
282      }
283
284      /**
285       * Does this object have a 'friends' connection?
286       * 
287       * @return {@code true} if this object has a 'friends' connection, {@code false} otherwise.
288       */
289      public Boolean hasFriends() {
290        return !isBlank(friends);
291      }
292
293      /**
294       * Does this object have a 'family' connection?
295       * 
296       * @return {@code true} if this object has a 'family' connection, {@code false} otherwise.
297       */
298      public Boolean hasFamily() {
299        return !isBlank(family);
300      }
301
302      /**
303       * Does this object have an 'activities' connection?
304       * 
305       * @return {@code true} if this object has an 'activities' connection, {@code false} otherwise.
306       */
307      public Boolean hasActivities() {
308        return !isBlank(activities);
309      }
310
311      /**
312       * Does this object have an 'interests' connection?
313       * 
314       * @return {@code true} if this object has an 'interests' connection, {@code false} otherwise.
315       */
316      public Boolean hasInterests() {
317        return !isBlank(interests);
318      }
319
320      /**
321       * Does this object have a 'music' connection?
322       * 
323       * @return {@code true} if this object has a 'music' connection, {@code false} otherwise.
324       */
325      public Boolean hasMusic() {
326        return !isBlank(music);
327      }
328
329      /**
330       * Does this object have a 'books' connection?
331       * 
332       * @return {@code true} if this object has a 'books' connection, {@code false} otherwise.
333       */
334      public Boolean hasBooks() {
335        return !isBlank(books);
336      }
337
338      /**
339       * Does this object have a 'movies' connection?
340       * 
341       * @return {@code true} if this object has a 'movies' connection, {@code false} otherwise.
342       */
343      public Boolean hasMovies() {
344        return !isBlank(movies);
345      }
346
347      /**
348       * Does this object have a 'television' connection?
349       * 
350       * @return {@code true} if this object has a 'television' connection, {@code false} otherwise.
351       */
352      public Boolean hasTelevision() {
353        return !isBlank(television);
354      }
355
356      /**
357       * Does this object have a 'likes' connection?
358       * 
359       * @return {@code true} if this object has a 'likes' connection, {@code false} otherwise.
360       */
361      public Boolean hasLikes() {
362        return !isBlank(likes);
363      }
364
365      /**
366       * Does this object have a 'posts' connection?
367       * 
368       * @return {@code true} if this object has a 'posts' connection, {@code false} otherwise.
369       */
370      public Boolean hasPosts() {
371        return !isBlank(posts);
372      }
373
374      /**
375       * Does this object have a 'tagged' connection?
376       * 
377       * @return {@code true} if this object has a 'tagged' connection, {@code false} otherwise.
378       */
379      public Boolean hasTagged() {
380        return !isBlank(tagged);
381      }
382
383      /**
384       * Does this object have a 'statuses' connection?
385       * 
386       * @return {@code true} if this object has a 'statuses' connection, {@code false} otherwise.
387       */
388      public Boolean hasStatuses() {
389        return !isBlank(statuses);
390      }
391
392      /**
393       * Does this object have a 'links' connection?
394       * 
395       * @return {@code true} if this object has a 'links' connection, {@code false} otherwise.
396       */
397      public Boolean hasLinks() {
398        return !isBlank(links);
399      }
400
401      /**
402       * Does this object have a 'notes' connection?
403       * 
404       * @return {@code true} if this object has a 'notes' connection, {@code false} otherwise.
405       */
406      public Boolean hasNotes() {
407        return !isBlank(notes);
408      }
409
410      /**
411       * Does this object have a 'photos' connection?
412       * 
413       * @return {@code true} if this object has a 'photos' connection, {@code false} otherwise.
414       */
415      public Boolean hasPhotos() {
416        return !isBlank(photos);
417      }
418
419      /**
420       * Does this object have an 'albums' connection?
421       * 
422       * @return {@code true} if this object has an 'albums' connection, {@code false} otherwise.
423       */
424      public Boolean hasAlbums() {
425        return !isBlank(albums);
426      }
427
428      /**
429       * Does this object have an 'events' connection?
430       * 
431       * @return {@code true} if this object has an 'events' connection, {@code false} otherwise.
432       */
433      public Boolean hasEvents() {
434        return !isBlank(events);
435      }
436
437      /**
438       * Does this object have a 'groups' connection?
439       * 
440       * @return {@code true} if this object has a 'groups' connection, {@code false} otherwise.
441       */
442      public Boolean hasGroups() {
443        return !isBlank(groups);
444      }
445
446      /**
447       * Does this object have a 'videos' connection?
448       * 
449       * @return {@code true} if this object has a 'videos' connection, {@code false} otherwise.
450       */
451      public Boolean hasVideos() {
452        return !isBlank(videos);
453      }
454
455      /**
456       * Does this object have a 'picture' connection?
457       * 
458       * @return {@code true} if this object has a 'picture' connection, {@code false} otherwise.
459       */
460      public Boolean hasPicture() {
461        return !isBlank(picture);
462      }
463
464      /**
465       * Does this object have an 'inbox' connection?
466       * 
467       * @return {@code true} if this object has an 'inbox' connection, {@code false} otherwise.
468       */
469      public Boolean hasInbox() {
470        return !isBlank(inbox);
471      }
472
473      /**
474       * Does this object have an 'outbox' connection?
475       * 
476       * @return {@code true} if this object has an 'outbox' connection, {@code false} otherwise.
477       */
478      public Boolean hasOutbox() {
479        return !isBlank(outbox);
480      }
481
482      /**
483       * Does this object have an 'updates' connection?
484       * 
485       * @return {@code true} if this object has an 'updates' connection, {@code false} otherwise.
486       */
487      public Boolean hasUpdates() {
488        return !isBlank(updates);
489      }
490
491      @java.lang.SuppressWarnings("all")
492      public String getHome() {
493        return this.home;
494      }
495
496      @java.lang.SuppressWarnings("all")
497      public void setHome(final String home) {
498        this.home = home;
499      }
500
501      @java.lang.SuppressWarnings("all")
502      public String getFeed() {
503        return this.feed;
504      }
505
506      @java.lang.SuppressWarnings("all")
507      public void setFeed(final String feed) {
508        this.feed = feed;
509      }
510
511      @java.lang.SuppressWarnings("all")
512      public String getFriends() {
513        return this.friends;
514      }
515
516      @java.lang.SuppressWarnings("all")
517      public void setFriends(final String friends) {
518        this.friends = friends;
519      }
520
521      @java.lang.SuppressWarnings("all")
522      public String getFamily() {
523        return this.family;
524      }
525
526      @java.lang.SuppressWarnings("all")
527      public void setFamily(final String family) {
528        this.family = family;
529      }
530
531      @java.lang.SuppressWarnings("all")
532      public String getActivities() {
533        return this.activities;
534      }
535
536      @java.lang.SuppressWarnings("all")
537      public void setActivities(final String activities) {
538        this.activities = activities;
539      }
540
541      @java.lang.SuppressWarnings("all")
542      public String getInterests() {
543        return this.interests;
544      }
545
546      @java.lang.SuppressWarnings("all")
547      public void setInterests(final String interests) {
548        this.interests = interests;
549      }
550
551      @java.lang.SuppressWarnings("all")
552      public String getMusic() {
553        return this.music;
554      }
555
556      @java.lang.SuppressWarnings("all")
557      public void setMusic(final String music) {
558        this.music = music;
559      }
560
561      @java.lang.SuppressWarnings("all")
562      public String getBooks() {
563        return this.books;
564      }
565
566      @java.lang.SuppressWarnings("all")
567      public void setBooks(final String books) {
568        this.books = books;
569      }
570
571      @java.lang.SuppressWarnings("all")
572      public String getMovies() {
573        return this.movies;
574      }
575
576      @java.lang.SuppressWarnings("all")
577      public void setMovies(final String movies) {
578        this.movies = movies;
579      }
580
581      @java.lang.SuppressWarnings("all")
582      public String getTelevision() {
583        return this.television;
584      }
585
586      @java.lang.SuppressWarnings("all")
587      public void setTelevision(final String television) {
588        this.television = television;
589      }
590
591      @java.lang.SuppressWarnings("all")
592      public String getLikes() {
593        return this.likes;
594      }
595
596      @java.lang.SuppressWarnings("all")
597      public void setLikes(final String likes) {
598        this.likes = likes;
599      }
600
601      @java.lang.SuppressWarnings("all")
602      public String getPosts() {
603        return this.posts;
604      }
605
606      @java.lang.SuppressWarnings("all")
607      public void setPosts(final String posts) {
608        this.posts = posts;
609      }
610
611      @java.lang.SuppressWarnings("all")
612      public String getTagged() {
613        return this.tagged;
614      }
615
616      @java.lang.SuppressWarnings("all")
617      public void setTagged(final String tagged) {
618        this.tagged = tagged;
619      }
620
621      @java.lang.SuppressWarnings("all")
622      public String getStatuses() {
623        return this.statuses;
624      }
625
626      @java.lang.SuppressWarnings("all")
627      public void setStatuses(final String statuses) {
628        this.statuses = statuses;
629      }
630
631      @java.lang.SuppressWarnings("all")
632      public String getLinks() {
633        return this.links;
634      }
635
636      @java.lang.SuppressWarnings("all")
637      public void setLinks(final String links) {
638        this.links = links;
639      }
640
641      @java.lang.SuppressWarnings("all")
642      public String getNotes() {
643        return this.notes;
644      }
645
646      @java.lang.SuppressWarnings("all")
647      public void setNotes(final String notes) {
648        this.notes = notes;
649      }
650
651      @java.lang.SuppressWarnings("all")
652      public String getPhotos() {
653        return this.photos;
654      }
655
656      @java.lang.SuppressWarnings("all")
657      public void setPhotos(final String photos) {
658        this.photos = photos;
659      }
660
661      @java.lang.SuppressWarnings("all")
662      public String getAlbums() {
663        return this.albums;
664      }
665
666      @java.lang.SuppressWarnings("all")
667      public void setAlbums(final String albums) {
668        this.albums = albums;
669      }
670
671      @java.lang.SuppressWarnings("all")
672      public String getEvents() {
673        return this.events;
674      }
675
676      @java.lang.SuppressWarnings("all")
677      public void setEvents(final String events) {
678        this.events = events;
679      }
680
681      @java.lang.SuppressWarnings("all")
682      public String getGroups() {
683        return this.groups;
684      }
685
686      @java.lang.SuppressWarnings("all")
687      public void setGroups(final String groups) {
688        this.groups = groups;
689      }
690
691      @java.lang.SuppressWarnings("all")
692      public String getVideos() {
693        return this.videos;
694      }
695
696      @java.lang.SuppressWarnings("all")
697      public void setVideos(final String videos) {
698        this.videos = videos;
699      }
700
701      @java.lang.SuppressWarnings("all")
702      public String getPicture() {
703        return this.picture;
704      }
705
706      @java.lang.SuppressWarnings("all")
707      public void setPicture(final String picture) {
708        this.picture = picture;
709      }
710
711      @java.lang.SuppressWarnings("all")
712      public String getInbox() {
713        return this.inbox;
714      }
715
716      @java.lang.SuppressWarnings("all")
717      public void setInbox(final String inbox) {
718        this.inbox = inbox;
719      }
720
721      @java.lang.SuppressWarnings("all")
722      public String getOutbox() {
723        return this.outbox;
724      }
725
726      @java.lang.SuppressWarnings("all")
727      public void setOutbox(final String outbox) {
728        this.outbox = outbox;
729      }
730
731      @java.lang.SuppressWarnings("all")
732      public String getUpdates() {
733        return this.updates;
734      }
735
736      @java.lang.SuppressWarnings("all")
737      public void setUpdates(final String updates) {
738        this.updates = updates;
739      }
740    }
741
742    /**
743     * Existing fields in the current type
744     * 
745     * @return list of field of the current type
746     * @since 1.6.16
747     */
748    public List<NamedFacebookType> getFields() {
749      return Collections.unmodifiableList(fields);
750    }
751
752    public boolean addField(NamedFacebookType field) {
753      return fields.add(field);
754    }
755
756    public boolean removeField(NamedFacebookType field) {
757      return fields.remove(field);
758    }
759
760    @java.lang.SuppressWarnings("all")
761    public Connections getConnections() {
762      return this.connections;
763    }
764
765    @java.lang.SuppressWarnings("all")
766    public void setConnections(final Connections connections) {
767      this.connections = connections;
768    }
769
770    @java.lang.SuppressWarnings("all")
771    public String getType() {
772      return this.type;
773    }
774
775    @java.lang.SuppressWarnings("all")
776    public void setType(final String type) {
777      this.type = type;
778    }
779  }
780
781  /**
782   * This object's unique Facebook ID.
783   * 
784   * @return This object's unique Facebook ID.
785   */
786  @java.lang.SuppressWarnings("all")
787  public String getId() {
788    return this.id;
789  }
790
791  /**
792   * This object's unique Facebook ID.
793   */
794  @java.lang.SuppressWarnings("all")
795  public void setId(final String id) {
796    this.id = id;
797  }
798
799  /**
800   *
801   * @return This object's metadata, available by including the {@code metadata=1} URL parameter in an API request.
802   */
803  @java.lang.SuppressWarnings("all")
804  public Metadata getMetadata() {
805    return this.metadata;
806  }
807
808  /**
809   * This object's metadata, available by including the {@code metadata=1} URL parameter in an API request.
810   */
811  @java.lang.SuppressWarnings("all")
812  public void setMetadata(final Metadata metadata) {
813    this.metadata = metadata;
814  }
815
816  @java.lang.SuppressWarnings("all")
817  public String getType() {
818    return this.type;
819  }
820
821  @java.lang.SuppressWarnings("all")
822  public void setType(final String type) {
823    this.type = type;
824  }
825}