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 java.util.Collections.unmodifiableList;
026import java.util.ArrayList;
027import java.util.Date;
028import java.util.List;
029import com.restfb.Facebook;
030import com.restfb.types.features.HasCreatedTime;
031import com.restfb.types.features.HasFrom;
032import com.restfb.types.features.HasMessage;
033
034/**
035 * Represents the <a href="http://developers.facebook.com/docs/reference/api/checkin">Check-In Graph API type</a>.
036 * 
037 * @author <a href="http://restfb.com">Mark Allen</a>
038 * @since 1.6
039 */
040public class Checkin extends FacebookType implements HasCreatedTime, HasFrom, HasMessage {
041  /**
042   * The message the user added to the check-in.
043   * 
044   */
045  @Facebook
046  private String message;
047  /**
048   * The ID and name of the user who made the check-in.
049   * 
050   */
051  @Facebook
052  private NamedFacebookType from;
053  /**
054   * The ID and name of the application that made the check-in.
055   * 
056   */
057  @Facebook
058  private NamedFacebookType application;
059  /**
060   * The ID, name, and location of the Facebook Page that represents the location of the check-in.
061   * 
062   */
063  @Facebook
064  private Place place;
065  /**
066   * The time the check-in was created.
067   * 
068   */
069  @Facebook("created_time")
070  private Date createdTime;
071  @Facebook
072  private List<Comment> comments = new ArrayList<>();
073  @Facebook
074  private List<NamedFacebookType> tags = new ArrayList<>();
075  private static final long serialVersionUID = 2L;
076
077  /**
078   * The comments for the check-in.
079   * 
080   * @return The comments for the check-in.
081   */
082  public List<Comment> getComments() {
083    return unmodifiableList(comments);
084  }
085
086  public boolean addComment(Comment comment) {
087    return comments.add(comment);
088  }
089
090  public boolean removeComment(Comment comment) {
091    return comments.remove(comment);
092  }
093
094  /**
095   * Tags for the check-in. I.e. Users tagged in the check-in
096   * 
097   * @return Tags for the check-in.
098   */
099  public List<NamedFacebookType> getTags() {
100    return unmodifiableList(tags);
101  }
102
103  public boolean addTag(NamedFacebookType tag) {
104    return tags.add(tag);
105  }
106
107  public boolean removeTag(NamedFacebookType tag) {
108    return tags.remove(tag);
109  }
110
111  /**
112   * The message the user added to the check-in.
113   * 
114   * @return The message the user added to the check-in.
115   */
116  @Override
117  @java.lang.SuppressWarnings("all")
118  public String getMessage() {
119    return this.message;
120  }
121
122  /**
123   * The message the user added to the check-in.
124   * 
125   */
126  @java.lang.SuppressWarnings("all")
127  public void setMessage(final String message) {
128    this.message = message;
129  }
130
131  /**
132   * The ID and name of the user who made the check-in.
133   * 
134   * @return The ID and name of the user who made the check-in.
135   */
136  @Override
137  @java.lang.SuppressWarnings("all")
138  public NamedFacebookType getFrom() {
139    return this.from;
140  }
141
142  /**
143   * The ID and name of the user who made the check-in.
144   * 
145   */
146  @java.lang.SuppressWarnings("all")
147  public void setFrom(final NamedFacebookType from) {
148    this.from = from;
149  }
150
151  /**
152   * The ID and name of the application that made the check-in.
153   * 
154   * @return The ID and name of the application that made the check-in.
155   */
156  @java.lang.SuppressWarnings("all")
157  public NamedFacebookType getApplication() {
158    return this.application;
159  }
160
161  /**
162   * The ID and name of the application that made the check-in.
163   * 
164   */
165  @java.lang.SuppressWarnings("all")
166  public void setApplication(final NamedFacebookType application) {
167    this.application = application;
168  }
169
170  /**
171   * The ID, name, and location of the Facebook Page that represents the location of the check-in.
172   * 
173   * @return The ID, name, and location of the Facebook Page that represents the location of the check-in.
174   */
175  @java.lang.SuppressWarnings("all")
176  public Place getPlace() {
177    return this.place;
178  }
179
180  /**
181   * The ID, name, and location of the Facebook Page that represents the location of the check-in.
182   * 
183   */
184  @java.lang.SuppressWarnings("all")
185  public void setPlace(final Place place) {
186    this.place = place;
187  }
188
189  /**
190   * The time the check-in was created.
191   * 
192   * @return The time the check-in was created.
193   */
194  @Override
195  @java.lang.SuppressWarnings("all")
196  public Date getCreatedTime() {
197    return this.createdTime;
198  }
199
200  /**
201   * The time the check-in was created.
202   * 
203   */
204  @java.lang.SuppressWarnings("all")
205  public void setCreatedTime(final Date createdTime) {
206    this.createdTime = createdTime;
207  }
208}