Package com.twitter.clientlib.model
Class Poll
- java.lang.Object
-
- com.twitter.clientlib.model.Poll
-
@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class Poll extends Object
Represent a Poll attached to a Tweet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPoll.CustomTypeAdapterFactorystatic classPoll.VotingStatusEnumGets or Sets votingStatus
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>openapiFieldsstatic HashSet<String>openapiRequiredFieldsstatic StringSERIALIZED_NAME_DURATION_MINUTESstatic StringSERIALIZED_NAME_END_DATETIMEstatic StringSERIALIZED_NAME_IDstatic StringSERIALIZED_NAME_OPTIONSstatic StringSERIALIZED_NAME_VOTING_STATUS
-
Constructor Summary
Constructors Constructor Description Poll()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PolladdOptionsItem(PollOption optionsItem)PolldurationMinutes(Integer durationMinutes)PollendDatetime(OffsetDateTime endDatetime)booleanequals(Object o)static PollfromJson(String jsonString)Create an instance of Poll given an JSON stringIntegergetDurationMinutes()Get durationMinutesOffsetDateTimegetEndDatetime()Get endDatetimeStringgetId()Unique identifier of this poll.List<PollOption>getOptions()Get optionsPoll.VotingStatusEnumgetVotingStatus()Get votingStatusinthashCode()Pollid(String id)Polloptions(List<PollOption> options)voidsetDurationMinutes(Integer durationMinutes)voidsetEndDatetime(OffsetDateTime endDatetime)voidsetId(String id)voidsetOptions(List<PollOption> options)voidsetVotingStatus(Poll.VotingStatusEnum votingStatus)StringtoJson()Convert an instance of Poll to an JSON stringStringtoString()static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj)Validates the JSON Object and throws an exception if issues foundPollvotingStatus(Poll.VotingStatusEnum votingStatus)
-
-
-
Field Detail
-
SERIALIZED_NAME_ID
public static final String SERIALIZED_NAME_ID
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_OPTIONS
public static final String SERIALIZED_NAME_OPTIONS
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_VOTING_STATUS
public static final String SERIALIZED_NAME_VOTING_STATUS
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_END_DATETIME
public static final String SERIALIZED_NAME_END_DATETIME
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_DURATION_MINUTES
public static final String SERIALIZED_NAME_DURATION_MINUTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
setId
public void setId(String id)
-
options
public Poll options(List<PollOption> options)
-
addOptionsItem
public Poll addOptionsItem(PollOption optionsItem)
-
getOptions
@Nonnull public List<PollOption> getOptions()
Get options- Returns:
- options
-
setOptions
public void setOptions(List<PollOption> options)
-
votingStatus
public Poll votingStatus(Poll.VotingStatusEnum votingStatus)
-
getVotingStatus
@Nullable public Poll.VotingStatusEnum getVotingStatus()
Get votingStatus- Returns:
- votingStatus
-
setVotingStatus
public void setVotingStatus(Poll.VotingStatusEnum votingStatus)
-
endDatetime
public Poll endDatetime(OffsetDateTime endDatetime)
-
getEndDatetime
@Nullable public OffsetDateTime getEndDatetime()
Get endDatetime- Returns:
- endDatetime
-
setEndDatetime
public void setEndDatetime(OffsetDateTime endDatetime)
-
getDurationMinutes
@Nullable public Integer getDurationMinutes()
Get durationMinutes- Returns:
- durationMinutes
-
setDurationMinutes
public void setDurationMinutes(Integer durationMinutes)
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOExceptionValidates the JSON Object and throws an exception if issues found- Parameters:
jsonObj- JSON Object- Throws:
IOException- if the JSON Object is invalid with respect to Poll
-
fromJson
public static Poll fromJson(String jsonString) throws IOException
Create an instance of Poll given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Poll
- Throws:
IOException- if the JSON string is invalid with respect to Poll
-
toJson
public String toJson()
Convert an instance of Poll to an JSON string- Returns:
- JSON string
-
-