001// Generated by delombok at Tue Aug 13 21:51:28 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 java.util.ArrayList;
026import java.util.Collections;
027import java.util.List;
028import com.restfb.Facebook;
029
030public class VideoPoll extends FacebookType {
031  private static final long serialVersionUID = 1L;
032  /**
033   * True if this is a Live poll with open voting and the card hides after voting
034   */
035  @Facebook("close_after_voting")
036  private Boolean closeAfterVoting;
037  /**
038   * True if the poll should be open by default, false if it starts in a closed state
039   */
040  @Facebook("default_open")
041  private Boolean defaultOpen;
042  /**
043   * The poll question text
044   */
045  @Facebook
046  private String question;
047  /**
048   * True if this is a Live poll and voting is open and there is a background gradient to highlight the voting card
049   *
050   *         card
051   */
052  @Facebook("show_gradient")
053  private Boolean showGradient;
054  /**
055   * True if this is a Live poll and voting is open and the results show after voting
056   */
057  @Facebook("show_results")
058  private Boolean showResults;
059  /**
060   * Live poll status
061   */
062  @Facebook
063  private String status;
064  @Facebook("poll_options")
065  private List<VideoPollOption> pollOptions = new ArrayList<>();
066
067  public List<VideoPollOption> getPollOptions() {
068    return Collections.unmodifiableList(pollOptions);
069  }
070
071  public boolean addPollOption(VideoPollOption option) {
072    return pollOptions.add(option);
073  }
074
075  public boolean removePollOption(VideoPollOption option) {
076    return pollOptions.remove(option);
077  }
078
079
080  public static class VideoPollOption extends FacebookType {
081    private static final long serialVersionUID = 1L;
082    /**
083     * True if this answer is considered correct, otherwise false
084     *
085     * @return True if this answer is considered correct, otherwise false
086     */
087    @Facebook("is_correct")
088    private Boolean isCorrect;
089    /**
090     * Options appear in increasing numerical order within a poll
091     *
092     * @return Options appear in increasing numerical order within a poll
093     */
094    @Facebook
095    private Long order;
096    /**
097     * Text to display to the user for this option
098     *
099     * @return Text to display to the user for this option
100     */
101    @Facebook
102    private String text;
103    /**
104     * Total number of votes for this option
105     *
106     * @return Total number of votes for this option
107     */
108    @Facebook("total_votes")
109    private Long totalVotes;
110
111    @java.lang.SuppressWarnings("all")
112    public Boolean getIsCorrect() {
113      return this.isCorrect;
114    }
115
116    @java.lang.SuppressWarnings("all")
117    public void setIsCorrect(final Boolean isCorrect) {
118      this.isCorrect = isCorrect;
119    }
120
121    @java.lang.SuppressWarnings("all")
122    public Long getOrder() {
123      return this.order;
124    }
125
126    @java.lang.SuppressWarnings("all")
127    public void setOrder(final Long order) {
128      this.order = order;
129    }
130
131    @java.lang.SuppressWarnings("all")
132    public String getText() {
133      return this.text;
134    }
135
136    @java.lang.SuppressWarnings("all")
137    public void setText(final String text) {
138      this.text = text;
139    }
140
141    @java.lang.SuppressWarnings("all")
142    public Long getTotalVotes() {
143      return this.totalVotes;
144    }
145
146    @java.lang.SuppressWarnings("all")
147    public void setTotalVotes(final Long totalVotes) {
148      this.totalVotes = totalVotes;
149    }
150  }
151
152  /**
153   * True if this is a Live poll with open voting and the card hides after voting
154   *
155   * @return True if this is a Live poll with open voting and the card hides after voting
156   */
157  @java.lang.SuppressWarnings("all")
158  public Boolean getCloseAfterVoting() {
159    return this.closeAfterVoting;
160  }
161
162  /**
163   * True if this is a Live poll with open voting and the card hides after voting
164   */
165  @java.lang.SuppressWarnings("all")
166  public void setCloseAfterVoting(final Boolean closeAfterVoting) {
167    this.closeAfterVoting = closeAfterVoting;
168  }
169
170  /**
171   * True if the poll should be open by default, false if it starts in a closed state
172   *
173   * @return True if the poll should be open by default, false if it starts in a closed state
174   */
175  @java.lang.SuppressWarnings("all")
176  public Boolean getDefaultOpen() {
177    return this.defaultOpen;
178  }
179
180  /**
181   * True if the poll should be open by default, false if it starts in a closed state
182   */
183  @java.lang.SuppressWarnings("all")
184  public void setDefaultOpen(final Boolean defaultOpen) {
185    this.defaultOpen = defaultOpen;
186  }
187
188  /**
189   * The poll question text
190   *
191   * @return The poll question text
192   */
193  @java.lang.SuppressWarnings("all")
194  public String getQuestion() {
195    return this.question;
196  }
197
198  /**
199   * The poll question text
200   */
201  @java.lang.SuppressWarnings("all")
202  public void setQuestion(final String question) {
203    this.question = question;
204  }
205
206  /**
207   * True if this is a Live poll and voting is open and there is a background gradient to highlight the voting card
208   *
209   * @return True if this is a Live poll and voting is open and there is a background gradient to highlight the voting
210   *         card
211   */
212  @java.lang.SuppressWarnings("all")
213  public Boolean getShowGradient() {
214    return this.showGradient;
215  }
216
217  /**
218   * True if this is a Live poll and voting is open and there is a background gradient to highlight the voting card
219   *
220   *         card
221   */
222  @java.lang.SuppressWarnings("all")
223  public void setShowGradient(final Boolean showGradient) {
224    this.showGradient = showGradient;
225  }
226
227  /**
228   * True if this is a Live poll and voting is open and the results show after voting
229   *
230   * @return True if this is a Live poll and voting is open and the results show after voting
231   */
232  @java.lang.SuppressWarnings("all")
233  public Boolean getShowResults() {
234    return this.showResults;
235  }
236
237  /**
238   * True if this is a Live poll and voting is open and the results show after voting
239   */
240  @java.lang.SuppressWarnings("all")
241  public void setShowResults(final Boolean showResults) {
242    this.showResults = showResults;
243  }
244
245  /**
246   * Live poll status
247   *
248   * @return Live poll status
249   */
250  @java.lang.SuppressWarnings("all")
251  public String getStatus() {
252    return this.status;
253  }
254
255  /**
256   * Live poll status
257   */
258  @java.lang.SuppressWarnings("all")
259  public void setStatus(final String status) {
260    this.status = status;
261  }
262}