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