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 class
Poll.CustomTypeAdapterFactory
static class
Poll.VotingStatusEnum
Gets or Sets votingStatus
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>
openapiFields
static HashSet<String>
openapiRequiredFields
static String
SERIALIZED_NAME_DURATION_MINUTES
static String
SERIALIZED_NAME_END_DATETIME
static String
SERIALIZED_NAME_ID
static String
SERIALIZED_NAME_OPTIONS
static String
SERIALIZED_NAME_VOTING_STATUS
-
Constructor Summary
Constructors Constructor Description Poll()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Poll
addOptionsItem(PollOption optionsItem)
Poll
durationMinutes(Integer durationMinutes)
Poll
endDatetime(OffsetDateTime endDatetime)
boolean
equals(Object o)
static Poll
fromJson(String jsonString)
Create an instance of Poll given an JSON stringInteger
getDurationMinutes()
Get durationMinutes minimum: 5 maximum: 10080OffsetDateTime
getEndDatetime()
Get endDatetimeString
getId()
Unique identifier of this poll.List<PollOption>
getOptions()
Get optionsPoll.VotingStatusEnum
getVotingStatus()
Get votingStatusint
hashCode()
Poll
id(String id)
Poll
options(List<PollOption> options)
void
setDurationMinutes(Integer durationMinutes)
void
setEndDatetime(OffsetDateTime endDatetime)
void
setId(String id)
void
setOptions(List<PollOption> options)
void
setVotingStatus(Poll.VotingStatusEnum votingStatus)
String
toJson()
Convert an instance of Poll to an JSON stringString
toString()
static void
validateJsonObject(com.google.gson.JsonObject jsonObj)
Validates the JSON Object and throws an exception if issues foundPoll
votingStatus(Poll.VotingStatusEnum votingStatus)
-
-
-
Field Detail
-
SERIALIZED_NAME_DURATION_MINUTES
public static final String SERIALIZED_NAME_DURATION_MINUTES
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_END_DATETIME
public static final String SERIALIZED_NAME_END_DATETIME
- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
getDurationMinutes
@Nullable public Integer getDurationMinutes()
Get durationMinutes minimum: 5 maximum: 10080- Returns:
- durationMinutes
-
setDurationMinutes
public void setDurationMinutes(Integer durationMinutes)
-
endDatetime
public Poll endDatetime(OffsetDateTime endDatetime)
-
getEndDatetime
@Nullable public OffsetDateTime getEndDatetime()
Get endDatetime- Returns:
- endDatetime
-
setEndDatetime
public void setEndDatetime(OffsetDateTime endDatetime)
-
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)
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOException
Validates 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
-
-