Package com.github.twitch4j.helix.domain
Class Prediction
java.lang.Object
com.github.twitch4j.helix.domain.Prediction
public class Prediction
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrediction.PredictionBuilder -
Constructor Summary
Constructors Constructor Description Prediction()Prediction(java.lang.String id, java.lang.String broadcasterId, java.lang.String broadcasterName, java.lang.String broadcasterLogin, java.lang.String title, @Nullable java.lang.String winningOutcomeId, java.util.List<com.github.twitch4j.eventsub.domain.PredictionOutcome> outcomes, java.lang.Integer predictionWindowSeconds, com.github.twitch4j.eventsub.domain.PredictionStatus status, java.time.Instant createdAt, @Nullable java.time.Instant endedAt, @Nullable java.time.Instant lockedAt) -
Method Summary
Modifier and Type Method Description static Prediction.PredictionBuilderbuilder()protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.lang.StringgetBroadcasterId()ID of the broadcaster.java.lang.StringgetBroadcasterLogin()Login name of the broadcaster.java.lang.StringgetBroadcasterName()Display name of the broadcaster.java.time.InstantgetCreatedAt()UTC timestamp for the Prediction’s start time.@Nullable java.time.InstantgetEndedAt()UTC timestamp for when the Prediction ended.java.lang.StringgetId()ID of the Prediction.@Nullable java.time.InstantgetLockedAt()UTC timestamp for when the Prediction was locked.java.util.List<com.github.twitch4j.eventsub.domain.PredictionOutcome>getOutcomes()The possible outcomes for the Prediction.@Nullable java.time.DurationgetPredictionWindow()java.lang.IntegergetPredictionWindowSeconds()Total duration for the Prediction (in seconds).com.github.twitch4j.eventsub.domain.PredictionStatusgetStatus()Status of the Prediction.java.lang.StringgetTitle()Title for the Prediction.java.util.Optional<com.github.twitch4j.eventsub.domain.PredictionOutcome>getWinningOutcome()@Nullable java.lang.StringgetWinningOutcomeId()ID of the winning outcome.inthashCode()Prediction.PredictionBuildertoBuilder()java.lang.StringtoString()PredictionwithBroadcasterId(java.lang.String broadcasterId)ID of the broadcaster.PredictionwithBroadcasterLogin(java.lang.String broadcasterLogin)Login name of the broadcaster.PredictionwithBroadcasterName(java.lang.String broadcasterName)Display name of the broadcaster.PredictionwithCreatedAt(java.time.Instant createdAt)UTC timestamp for the Prediction’s start time.PredictionwithEndedAt(@Nullable java.time.Instant endedAt)UTC timestamp for when the Prediction ended.PredictionwithId(java.lang.String id)ID of the Prediction.PredictionwithLockedAt(@Nullable java.time.Instant lockedAt)UTC timestamp for when the Prediction was locked.PredictionwithOutcomes(java.util.List<com.github.twitch4j.eventsub.domain.PredictionOutcome> outcomes)The possible outcomes for the Prediction.PredictionwithPredictionWindowSeconds(java.lang.Integer predictionWindowSeconds)Total duration for the Prediction (in seconds).PredictionwithStatus(com.github.twitch4j.eventsub.domain.PredictionStatus status)Status of the Prediction.PredictionwithTitle(java.lang.String title)Title for the Prediction.PredictionwithWinningOutcomeId(@Nullable java.lang.String winningOutcomeId)ID of the winning outcome.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
Prediction
public Prediction() -
Prediction
public Prediction(java.lang.String id, java.lang.String broadcasterId, java.lang.String broadcasterName, java.lang.String broadcasterLogin, java.lang.String title, @Nullable @Nullable java.lang.String winningOutcomeId, java.util.List<com.github.twitch4j.eventsub.domain.PredictionOutcome> outcomes, java.lang.Integer predictionWindowSeconds, com.github.twitch4j.eventsub.domain.PredictionStatus status, java.time.Instant createdAt, @Nullable @Nullable java.time.Instant endedAt, @Nullable @Nullable java.time.Instant lockedAt)
-
-
Method Details
-
getPredictionWindow
@Nullable public @Nullable java.time.Duration getPredictionWindow()- Returns:
- the total duration for the Prediction.
-
getWinningOutcome
public java.util.Optional<com.github.twitch4j.eventsub.domain.PredictionOutcome> getWinningOutcome()- Returns:
- the winning PredictionOutcome, in an optional wrapper
-
builder
-
toBuilder
-
withId
ID of the Prediction.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withBroadcasterId
ID of the broadcaster.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withBroadcasterName
Display name of the broadcaster.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withBroadcasterLogin
Login name of the broadcaster.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withTitle
Title for the Prediction. Maximum: 45 characters.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withWinningOutcomeId
ID of the winning outcome. If the status is ACTIVE, this is set to null.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withOutcomes
public Prediction withOutcomes(java.util.List<com.github.twitch4j.eventsub.domain.PredictionOutcome> outcomes)The possible outcomes for the Prediction. Size must be 2.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withPredictionWindowSeconds
Total duration for the Prediction (in seconds). Minimum: 1. Maximum: 1800.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withStatus
Status of the Prediction.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withCreatedAt
UTC timestamp for the Prediction’s start time.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withEndedAt
UTC timestamp for when the Prediction ended. If the status is ACTIVE, this is set to null.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
withLockedAt
UTC timestamp for when the Prediction was locked. If the status is not LOCKED, this is set to null.- Returns:
- a clone of this object, except with this updated property (returns
thisif an identical value is passed).
-
getId
public java.lang.String getId()ID of the Prediction. -
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()Title for the Prediction. Maximum: 45 characters. -
getWinningOutcomeId
@Nullable public @Nullable java.lang.String getWinningOutcomeId()ID of the winning outcome. If the status is ACTIVE, this is set to null. -
getOutcomes
public java.util.List<com.github.twitch4j.eventsub.domain.PredictionOutcome> getOutcomes()The possible outcomes for the Prediction. Size must be 2. -
getPredictionWindowSeconds
public java.lang.Integer getPredictionWindowSeconds()Total duration for the Prediction (in seconds). Minimum: 1. Maximum: 1800. -
getStatus
public com.github.twitch4j.eventsub.domain.PredictionStatus getStatus()Status of the Prediction. -
getCreatedAt
public java.time.Instant getCreatedAt()UTC timestamp for the Prediction’s start time. -
getEndedAt
@Nullable public @Nullable java.time.Instant getEndedAt()UTC timestamp for when the Prediction ended. If the status is ACTIVE, this is set to null. -
getLockedAt
@Nullable public @Nullable java.time.Instant getLockedAt()UTC timestamp for when the Prediction was locked. If the status is not LOCKED, this is set to null. -
equals
public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other) -
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-