Package com.twitter.clientlib.model
Class PollOption
- java.lang.Object
-
- com.twitter.clientlib.model.PollOption
-
@Generated("org.openapitools.codegen.languages.JavaClientCodegen") public class PollOption extends Object
Describes a choice in a Poll object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PollOption.CustomTypeAdapterFactory
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>
openapiFields
static HashSet<String>
openapiRequiredFields
static String
SERIALIZED_NAME_LABEL
static String
SERIALIZED_NAME_POSITION
static String
SERIALIZED_NAME_VOTES
-
Constructor Summary
Constructors Constructor Description PollOption()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static PollOption
fromJson(String jsonString)
Create an instance of PollOption given an JSON stringString
getLabel()
The text of a poll choice.Integer
getPosition()
Position of this choice in the poll.Integer
getVotes()
Number of users who voted for this choice.int
hashCode()
PollOption
label(String label)
PollOption
position(Integer position)
void
setLabel(String label)
void
setPosition(Integer position)
void
setVotes(Integer votes)
String
toJson()
Convert an instance of PollOption to an JSON stringString
toString()
static void
validateJsonObject(com.google.gson.JsonObject jsonObj)
Validates the JSON Object and throws an exception if issues foundPollOption
votes(Integer votes)
-
-
-
Field Detail
-
SERIALIZED_NAME_LABEL
public static final String SERIALIZED_NAME_LABEL
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_POSITION
public static final String SERIALIZED_NAME_POSITION
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_VOTES
public static final String SERIALIZED_NAME_VOTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
label
public PollOption label(String label)
-
setLabel
public void setLabel(String label)
-
position
public PollOption position(Integer position)
-
getPosition
@Nonnull public Integer getPosition()
Position of this choice in the poll.- Returns:
- position
-
setPosition
public void setPosition(Integer position)
-
votes
public PollOption votes(Integer votes)
-
getVotes
@Nonnull public Integer getVotes()
Number of users who voted for this choice.- Returns:
- votes
-
setVotes
public void setVotes(Integer votes)
-
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 PollOption
-
fromJson
public static PollOption fromJson(String jsonString) throws IOException
Create an instance of PollOption given an JSON string- Parameters:
jsonString
- JSON string- Returns:
- An instance of PollOption
- Throws:
IOException
- if the JSON string is invalid with respect to PollOption
-
toJson
public String toJson()
Convert an instance of PollOption to an JSON string- Returns:
- JSON string
-
-