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