Class Poll

java.lang.Object
com.github.twitch4j.helix.domain.Poll

public class Poll
extends java.lang.Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  Poll.PollBuilder  
  • Constructor Summary

    Constructors
    Constructor Description
    Poll()  
    Poll​(java.lang.String id, java.lang.String broadcasterId, java.lang.String broadcasterName, java.lang.String broadcasterLogin, java.lang.String title, java.util.List<com.github.twitch4j.eventsub.domain.PollChoice> choices, java.lang.Boolean isBitsVotingEnabled, java.lang.Integer bitsPerVote, java.lang.Boolean isChannelPointsVotingEnabled, java.lang.Integer channelPointsPerVote, com.github.twitch4j.eventsub.domain.PollStatus status, java.lang.Integer durationSeconds, java.time.Instant startedAt, @Nullable java.time.Instant endedAt)  
  • Method Summary

    Modifier and Type Method Description
    static Poll.PollBuilder builder()  
    protected boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    java.lang.Integer getBitsPerVote()
    Number of Bits required to vote once with Bits.
    java.lang.String getBroadcasterId()
    ID of the broadcaster.
    java.lang.String getBroadcasterLogin()
    Login name of the broadcaster.
    java.lang.String getBroadcasterName()
    Display name of the broadcaster.
    java.lang.Integer getChannelPointsPerVote()
    Number of Channel Points required to vote once with Channel Points.
    java.util.List<com.github.twitch4j.eventsub.domain.PollChoice> getChoices()
    The poll choices.
    @Nullable java.time.Duration getDuration()  
    java.lang.Integer getDurationSeconds()
    Total duration for the poll (in seconds).
    @Nullable java.time.Instant getEndedAt()
    UTC timestamp for the poll’s start time.
    java.lang.String getId()
    ID of the poll.
    java.time.Instant getStartedAt()
    UTC timestamp for the poll’s start time.
    com.github.twitch4j.eventsub.domain.PollStatus getStatus()
    Poll status.
    java.lang.String getTitle()
    Question displayed for the poll.
    int hashCode()  
    java.lang.Boolean isBitsVotingEnabled()
    Indicates whether Bits can be used for voting.
    java.lang.Boolean isChannelPointsVotingEnabled()
    Indicates whether Channel Points can be used for voting.
    Poll.PollBuilder toBuilder()  
    java.lang.String toString()  
    Poll withBitsPerVote​(java.lang.Integer bitsPerVote)
    Number of Bits required to vote once with Bits.
    Poll withBroadcasterId​(java.lang.String broadcasterId)
    ID of the broadcaster.
    Poll withBroadcasterLogin​(java.lang.String broadcasterLogin)
    Login name of the broadcaster.
    Poll withBroadcasterName​(java.lang.String broadcasterName)
    Display name of the broadcaster.
    Poll withChannelPointsPerVote​(java.lang.Integer channelPointsPerVote)
    Number of Channel Points required to vote once with Channel Points.
    Poll withChoices​(java.util.List<com.github.twitch4j.eventsub.domain.PollChoice> choices)
    The poll choices.
    Poll withDurationSeconds​(java.lang.Integer durationSeconds)
    Total duration for the poll (in seconds).
    Poll withEndedAt​(@Nullable java.time.Instant endedAt)
    UTC timestamp for the poll’s start time.
    Poll withId​(java.lang.String id)
    ID of the poll.
    Poll withIsBitsVotingEnabled​(java.lang.Boolean isBitsVotingEnabled)
    Indicates whether Bits can be used for voting.
    Poll withIsChannelPointsVotingEnabled​(java.lang.Boolean isChannelPointsVotingEnabled)
    Indicates whether Channel Points can be used for voting.
    Poll withStartedAt​(java.time.Instant startedAt)
    UTC timestamp for the poll’s start time.
    Poll withStatus​(com.github.twitch4j.eventsub.domain.PollStatus status)
    Poll status.
    Poll withTitle​(java.lang.String title)
    Question displayed for the poll.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Poll

      public Poll()
    • Poll

      public Poll​(java.lang.String id, java.lang.String broadcasterId, java.lang.String broadcasterName, java.lang.String broadcasterLogin, java.lang.String title, java.util.List<com.github.twitch4j.eventsub.domain.PollChoice> choices, java.lang.Boolean isBitsVotingEnabled, java.lang.Integer bitsPerVote, java.lang.Boolean isChannelPointsVotingEnabled, java.lang.Integer channelPointsPerVote, com.github.twitch4j.eventsub.domain.PollStatus status, java.lang.Integer durationSeconds, java.time.Instant startedAt, @Nullable @Nullable java.time.Instant endedAt)
  • Method Details

    • getDuration

      @Nullable public @Nullable java.time.Duration getDuration()
      Returns:
      the total duration for the poll.
    • builder

      public static Poll.PollBuilder builder()
    • toBuilder

      public Poll.PollBuilder toBuilder()
    • withId

      public Poll withId​(java.lang.String id)
      ID of the poll.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withBroadcasterId

      public Poll withBroadcasterId​(java.lang.String broadcasterId)
      ID of the broadcaster.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withBroadcasterName

      public Poll withBroadcasterName​(java.lang.String broadcasterName)
      Display name of the broadcaster.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withBroadcasterLogin

      public Poll withBroadcasterLogin​(java.lang.String broadcasterLogin)
      Login name of the broadcaster.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withTitle

      public Poll withTitle​(java.lang.String title)
      Question displayed for the poll. Maximum: 60 characters.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withChoices

      public Poll withChoices​(java.util.List<com.github.twitch4j.eventsub.domain.PollChoice> choices)
      The poll choices. Minimum: 2 choices. Maximum: 5 choices.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIsBitsVotingEnabled

      public Poll withIsBitsVotingEnabled​(java.lang.Boolean isBitsVotingEnabled)
      Indicates whether Bits can be used for voting. Default: false.
      Returns:
      this.
    • withBitsPerVote

      public Poll withBitsPerVote​(java.lang.Integer bitsPerVote)
      Number of Bits required to vote once with Bits. Minimum: 0. Maximum: 10000.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withIsChannelPointsVotingEnabled

      public Poll withIsChannelPointsVotingEnabled​(java.lang.Boolean isChannelPointsVotingEnabled)
      Indicates whether Channel Points can be used for voting. Default: false.
      Returns:
      this.
    • withChannelPointsPerVote

      public Poll withChannelPointsPerVote​(java.lang.Integer channelPointsPerVote)
      Number of Channel Points required to vote once with Channel Points. Minimum: 0. Maximum: 1000000.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withStatus

      public Poll withStatus​(com.github.twitch4j.eventsub.domain.PollStatus status)
      Poll status.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withDurationSeconds

      public Poll withDurationSeconds​(java.lang.Integer durationSeconds)
      Total duration for the poll (in seconds). Minimum: 15. Maximum: 1800.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withStartedAt

      public Poll withStartedAt​(java.time.Instant startedAt)
      UTC timestamp for the poll’s start time.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withEndedAt

      public Poll withEndedAt​(@Nullable @Nullable java.time.Instant endedAt)
      UTC timestamp for the poll’s start time.
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • getId

      public java.lang.String getId()
      ID of the poll.
    • getBroadcasterId

      public java.lang.String getBroadcasterId()
      ID of the broadcaster.
    • getBroadcasterName

      public java.lang.String getBroadcasterName()
      Display name of the broadcaster.
    • getBroadcasterLogin

      public java.lang.String getBroadcasterLogin()
      Login name of the broadcaster.
    • getTitle

      public java.lang.String getTitle()
      Question displayed for the poll. Maximum: 60 characters.
    • getChoices

      public java.util.List<com.github.twitch4j.eventsub.domain.PollChoice> getChoices()
      The poll choices. Minimum: 2 choices. Maximum: 5 choices.
    • isBitsVotingEnabled

      public java.lang.Boolean isBitsVotingEnabled()
      Indicates whether Bits can be used for voting. Default: false.
    • getBitsPerVote

      public java.lang.Integer getBitsPerVote()
      Number of Bits required to vote once with Bits. Minimum: 0. Maximum: 10000.
    • isChannelPointsVotingEnabled

      public java.lang.Boolean isChannelPointsVotingEnabled()
      Indicates whether Channel Points can be used for voting. Default: false.
    • getChannelPointsPerVote

      public java.lang.Integer getChannelPointsPerVote()
      Number of Channel Points required to vote once with Channel Points. Minimum: 0. Maximum: 1000000.
    • getStatus

      public com.github.twitch4j.eventsub.domain.PollStatus getStatus()
      Poll status.
    • getDurationSeconds

      public java.lang.Integer getDurationSeconds()
      Total duration for the poll (in seconds). Minimum: 15. Maximum: 1800.
    • getStartedAt

      public java.time.Instant getStartedAt()
      UTC timestamp for the poll’s start time.
    • getEndedAt

      @Nullable public @Nullable java.time.Instant getEndedAt()
      UTC timestamp for the poll’s start time.
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • canEqual

      protected boolean canEqual​(java.lang.Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object