Package com.github.twitch4j.helix.domain
Class Prediction
java.lang.Object
com.github.twitch4j.helix.domain.Prediction
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionPrediction
(String id, String broadcasterId, String broadcasterName, String broadcasterLogin, String title, @Nullable String winningOutcomeId, List<PredictionOutcome> outcomes, Integer predictionWindowSeconds, PredictionStatus status, Instant createdAt, @Nullable Instant endedAt, @Nullable Instant lockedAt) Creates a newPrediction
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic Prediction.PredictionBuilder
builder()
protected boolean
boolean
ID of the broadcaster.Login name of the broadcaster.Display name of the broadcaster.UTC timestamp for the Prediction’s start time.@Nullable Instant
UTC timestamp for when the Prediction ended.getId()
ID of the Prediction.@Nullable Instant
UTC timestamp for when the Prediction was locked.The possible outcomes for the Prediction.@Nullable Duration
Total duration for the Prediction (in seconds).Status of the Prediction.getTitle()
Title for the Prediction.@Nullable String
ID of the winning outcome.int
hashCode()
toString()
withBroadcasterId
(String broadcasterId) ID of the broadcaster.withBroadcasterLogin
(String broadcasterLogin) Login name of the broadcaster.withBroadcasterName
(String broadcasterName) Display name of the broadcaster.withCreatedAt
(Instant createdAt) UTC timestamp for the Prediction’s start time.withEndedAt
(@Nullable Instant endedAt) UTC timestamp for when the Prediction ended.ID of the Prediction.withLockedAt
(@Nullable Instant lockedAt) UTC timestamp for when the Prediction was locked.withOutcomes
(List<PredictionOutcome> outcomes) The possible outcomes for the Prediction.withPredictionWindowSeconds
(Integer predictionWindowSeconds) Total duration for the Prediction (in seconds).withStatus
(PredictionStatus status) Status of the Prediction.Title for the Prediction.withWinningOutcomeId
(@Nullable String winningOutcomeId) ID of the winning outcome.
-
Constructor Details
-
Prediction
public Prediction() -
Prediction
public Prediction(String id, String broadcasterId, String broadcasterName, String broadcasterLogin, String title, @Nullable @Nullable String winningOutcomeId, List<PredictionOutcome> outcomes, Integer predictionWindowSeconds, PredictionStatus status, Instant createdAt, @Nullable @Nullable Instant endedAt, @Nullable @Nullable Instant lockedAt) Creates a newPrediction
instance.- Parameters:
id
- ID of the Prediction.broadcasterId
- ID of the broadcaster.broadcasterName
- Display name of the broadcaster.broadcasterLogin
- Login name of the broadcaster.title
- Title for the Prediction. Maximum: 45 characters.winningOutcomeId
- ID of the winning outcome. If the status is ACTIVE, this is set to null.outcomes
- The possible outcomes for the Prediction. Size must be 2.predictionWindowSeconds
- Total duration for the Prediction (in seconds). Minimum: 1. Maximum: 1800.status
- Status of the Prediction.createdAt
- UTC timestamp for the Prediction’s start time.endedAt
- UTC timestamp for when the Prediction ended. If the status is ACTIVE, this is set to null.lockedAt
- UTC timestamp for when the Prediction was locked. If the status is not LOCKED, this is set to null.
-
-
Method Details
-
getPredictionWindow
- Returns:
- the total duration for the Prediction.
-
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
this
if an identical value is passed).
-
withBroadcasterId
ID of the broadcaster.- Returns:
- a clone of this object, except with this updated property (returns
this
if an identical value is passed).
-
withBroadcasterName
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
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
Title for the Prediction. Maximum: 45 characters.- Returns:
- a clone of this object, except with this updated property (returns
this
if 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
this
if an identical value is passed).
-
withOutcomes
The possible outcomes for the Prediction. Size must be 2.- Returns:
- a clone of this object, except with this updated property (returns
this
if 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
this
if an identical value is passed).
-
withStatus
Status of the Prediction.- Returns:
- a clone of this object, except with this updated property (returns
this
if 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
this
if 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
this
if 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
this
if an identical value is passed).
-
getId
ID of the Prediction. -
getBroadcasterId
ID of the broadcaster. -
getBroadcasterName
Display name of the broadcaster. -
getBroadcasterLogin
Login name of the broadcaster. -
getTitle
Title for the Prediction. Maximum: 45 characters. -
getWinningOutcomeId
ID of the winning outcome. If the status is ACTIVE, this is set to null. -
getOutcomes
The possible outcomes for the Prediction. Size must be 2. -
getPredictionWindowSeconds
Total duration for the Prediction (in seconds). Minimum: 1. Maximum: 1800. -
getStatus
Status of the Prediction. -
getCreatedAt
UTC timestamp for the Prediction’s start time. -
getEndedAt
UTC timestamp for when the Prediction ended. If the status is ACTIVE, this is set to null. -
getLockedAt
UTC timestamp for when the Prediction was locked. If the status is not LOCKED, this is set to null. -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-