Class SubscriptionData
java.lang.Object
com.github.twitch4j.pubsub.domain.SubscriptionData
public class SubscriptionData
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description SubscriptionData() -
Method Summary
Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.time.MonthgetBenefitEndMonth()java.lang.StringgetChannelId()The id of the channel where the subscription took placejava.lang.StringgetChannelName()The name of the channel where the subscription took placecom.github.twitch4j.common.enums.SubscriptionTypegetContext()The event type for this subscriptionjava.lang.IntegergetCumulativeMonths()How many months in total has the receiving user been subscribedjava.lang.StringgetDisplayName()The display name for the user that purchased the subscriptionjava.lang.BooleangetIsGift()Whether this sub message was caused by a gift subscriptionjava.lang.IntegergetMonths()Deprecated.java.lang.IntegergetMultiMonthDuration()Number of months gifted as part of a single, multi-month giftjava.lang.StringgetRecipientDisplayName()The display name of the user that received the subscriptionjava.lang.StringgetRecipientId()The id of the user that received the subscriptionjava.lang.StringgetRecipientUserName()The login name of the user that received the subscriptionjava.lang.IntegergetStreakMonths()How many months in a row has the receiving user been subscribedCommerceMessagegetSubMessage()The accompanying message when the subscription was sharedcom.github.twitch4j.common.enums.SubscriptionPlangetSubPlan()The type of subscription plan that was purchasedjava.lang.StringgetSubPlanName()The name of the subscription plan that was purchasedjava.lang.StringgetTime()Deprecated.in favor of getTimestamp()java.time.InstantgetTimestamp()RFC 3339 timestamp of when the subscription took placejava.lang.StringgetUserId()The id for the user that purchased the subscriptionjava.lang.StringgetUserName()The login name for the user that purchased the subscriptioninthashCode()voidsetBenefitEndMonth(java.lang.Integer benefitEndMonth)voidsetChannelId(java.lang.String channelId)The id of the channel where the subscription took placevoidsetChannelName(java.lang.String channelName)The name of the channel where the subscription took placevoidsetContext(com.github.twitch4j.common.enums.SubscriptionType context)The event type for this subscriptionvoidsetCumulativeMonths(java.lang.Integer cumulativeMonths)How many months in total has the receiving user been subscribedvoidsetDisplayName(java.lang.String displayName)The display name for the user that purchased the subscriptionvoidsetIsGift(java.lang.Boolean isGift)Whether this sub message was caused by a gift subscriptionvoidsetMonths(java.lang.Integer months)Deprecated.voidsetMultiMonthDuration(java.lang.Integer multiMonthDuration)Number of months gifted as part of a single, multi-month giftvoidsetRecipientDisplayName(java.lang.String recipientDisplayName)voidsetRecipientId(java.lang.String recipientId)voidsetRecipientUserName(java.lang.String recipientUserName)voidsetStreakMonths(java.lang.Integer streakMonths)How many months in a row has the receiving user been subscribedvoidsetSubMessage(CommerceMessage subMessage)The accompanying message when the subscription was sharedvoidsetSubPlan(com.github.twitch4j.common.enums.SubscriptionPlan subPlan)The type of subscription plan that was purchasedvoidsetSubPlanName(java.lang.String subPlanName)The name of the subscription plan that was purchasedvoidsetTimestamp(java.time.Instant timestamp)RFC 3339 timestamp of when the subscription took placevoidsetUserId(java.lang.String userId)The id for the user that purchased the subscriptionvoidsetUserName(java.lang.String userName)The login name for the user that purchased the subscriptionjava.lang.StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
SubscriptionData
public SubscriptionData()
-
-
Method Details
-
getRecipientId
public java.lang.String getRecipientId()The id of the user that received the subscription- Returns:
- the recipient id
-
getRecipientUserName
public java.lang.String getRecipientUserName()The login name of the user that received the subscription- Returns:
- the recipient name
-
getRecipientDisplayName
public java.lang.String getRecipientDisplayName()The display name of the user that received the subscription- Returns:
- the recipient display name
-
getBenefitEndMonth
public java.time.Month getBenefitEndMonth()- Returns:
- the new month the subscription will end on, in the case of an extendsub (otherwise null).
- See Also:
- Twitch Announcement (but not present in the official documentation)
-
getTime
@Deprecated public java.lang.String getTime()Deprecated.in favor of getTimestamp()- Returns:
- RFC 3339 timestamp of when the subscription took place
-
getUserName
public java.lang.String getUserName()The login name for the user that purchased the subscription -
getDisplayName
public java.lang.String getDisplayName()The display name for the user that purchased the subscription -
getChannelName
public java.lang.String getChannelName()The name of the channel where the subscription took place -
getUserId
public java.lang.String getUserId()The id for the user that purchased the subscription -
getChannelId
public java.lang.String getChannelId()The id of the channel where the subscription took place -
getTimestamp
public java.time.Instant getTimestamp()RFC 3339 timestamp of when the subscription took place -
getSubPlan
public com.github.twitch4j.common.enums.SubscriptionPlan getSubPlan()The type of subscription plan that was purchased -
getSubPlanName
public java.lang.String getSubPlanName()The name of the subscription plan that was purchased -
getMonths
@Deprecated public java.lang.Integer getMonths()Deprecated.The number of months the receiving user been subscribed- See Also:
getCumulativeMonths(),getStreakMonths()
-
getCumulativeMonths
public java.lang.Integer getCumulativeMonths()How many months in total has the receiving user been subscribed -
getStreakMonths
public java.lang.Integer getStreakMonths()How many months in a row has the receiving user been subscribed -
getContext
public com.github.twitch4j.common.enums.SubscriptionType getContext()The event type for this subscription -
getIsGift
public java.lang.Boolean getIsGift()Whether this sub message was caused by a gift subscription -
getMultiMonthDuration
public java.lang.Integer getMultiMonthDuration()Number of months gifted as part of a single, multi-month gift -
getSubMessage
The accompanying message when the subscription was shared -
setUserName
public void setUserName(java.lang.String userName)The login name for the user that purchased the subscription -
setDisplayName
public void setDisplayName(java.lang.String displayName)The display name for the user that purchased the subscription -
setChannelName
public void setChannelName(java.lang.String channelName)The name of the channel where the subscription took place -
setUserId
public void setUserId(java.lang.String userId)The id for the user that purchased the subscription -
setChannelId
public void setChannelId(java.lang.String channelId)The id of the channel where the subscription took place -
setTimestamp
public void setTimestamp(java.time.Instant timestamp)RFC 3339 timestamp of when the subscription took place -
setSubPlan
public void setSubPlan(com.github.twitch4j.common.enums.SubscriptionPlan subPlan)The type of subscription plan that was purchased -
setSubPlanName
public void setSubPlanName(java.lang.String subPlanName)The name of the subscription plan that was purchased -
setMonths
@Deprecated public void setMonths(java.lang.Integer months)Deprecated.The number of months the receiving user been subscribed- See Also:
getCumulativeMonths(),getStreakMonths()
-
setCumulativeMonths
public void setCumulativeMonths(java.lang.Integer cumulativeMonths)How many months in total has the receiving user been subscribed -
setStreakMonths
public void setStreakMonths(java.lang.Integer streakMonths)How many months in a row has the receiving user been subscribed -
setContext
public void setContext(com.github.twitch4j.common.enums.SubscriptionType context)The event type for this subscription -
setIsGift
public void setIsGift(java.lang.Boolean isGift)Whether this sub message was caused by a gift subscription -
setMultiMonthDuration
public void setMultiMonthDuration(java.lang.Integer multiMonthDuration)Number of months gifted as part of a single, multi-month gift -
setSubMessage
The accompanying message when the subscription was shared -
setBenefitEndMonth
public void setBenefitEndMonth(java.lang.Integer benefitEndMonth) -
setRecipientId
public void setRecipientId(java.lang.String recipientId) -
setRecipientUserName
public void setRecipientUserName(java.lang.String recipientUserName) -
setRecipientDisplayName
public void setRecipientDisplayName(java.lang.String recipientDisplayName) -
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
-