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 classPollOption.CustomTypeAdapterFactory
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>openapiFieldsstatic HashSet<String>openapiRequiredFieldsstatic StringSERIALIZED_NAME_LABELstatic StringSERIALIZED_NAME_POSITIONstatic StringSERIALIZED_NAME_VOTES
-
Constructor Summary
Constructors Constructor Description PollOption()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static PollOptionfromJson(String jsonString)Create an instance of PollOption given an JSON stringStringgetLabel()The text of a poll choice.IntegergetPosition()Position of this choice in the poll.IntegergetVotes()Number of users who voted for this choice.inthashCode()PollOptionlabel(String label)PollOptionposition(Integer position)voidsetLabel(String label)voidsetPosition(Integer position)voidsetVotes(Integer votes)StringtoJson()Convert an instance of PollOption to an JSON stringStringtoString()static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj)Validates the JSON Object and throws an exception if issues foundPollOptionvotes(Integer votes)
-
-
-
Field Detail
-
SERIALIZED_NAME_POSITION
public static final String SERIALIZED_NAME_POSITION
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_LABEL
public static final String SERIALIZED_NAME_LABEL
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_VOTES
public static final String SERIALIZED_NAME_VOTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
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)
-
label
public PollOption label(String label)
-
setLabel
public void setLabel(String label)
-
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 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 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
-
-