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 boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    java.time.Month getBenefitEndMonth()  
    java.lang.String getChannelId()
    The id of the channel where the subscription took place
    java.lang.String getChannelName()
    The name of the channel where the subscription took place
    com.github.twitch4j.common.enums.SubscriptionType getContext()
    The event type for this subscription
    java.lang.Integer getCumulativeMonths()
    How many months in total has the receiving user been subscribed
    java.lang.String getDisplayName()
    The display name for the user that purchased the subscription
    java.lang.Boolean getIsGift()
    Whether this sub message was caused by a gift subscription
    java.lang.Integer getMonths()
    Deprecated.
    java.lang.Integer getMultiMonthDuration()
    Number of months gifted as part of a single, multi-month gift
    java.lang.String getRecipientDisplayName()
    The display name of the user that received the subscription
    java.lang.String getRecipientId()
    The id of the user that received the subscription
    java.lang.String getRecipientUserName()
    The login name of the user that received the subscription
    java.lang.Integer getStreakMonths()
    How many months in a row has the receiving user been subscribed
    CommerceMessage getSubMessage()
    The accompanying message when the subscription was shared
    com.github.twitch4j.common.enums.SubscriptionPlan getSubPlan()
    The type of subscription plan that was purchased
    java.lang.String getSubPlanName()
    The name of the subscription plan that was purchased
    java.lang.String getTime()
    Deprecated.
    in favor of getTimestamp()
    java.time.Instant getTimestamp()
    RFC 3339 timestamp of when the subscription took place
    java.lang.String getUserId()
    The id for the user that purchased the subscription
    java.lang.String getUserName()
    The login name for the user that purchased the subscription
    int hashCode()  
    void setBenefitEndMonth​(java.lang.Integer benefitEndMonth)  
    void setChannelId​(java.lang.String channelId)
    The id of the channel where the subscription took place
    void setChannelName​(java.lang.String channelName)
    The name of the channel where the subscription took place
    void setContext​(com.github.twitch4j.common.enums.SubscriptionType context)
    The event type for this subscription
    void setCumulativeMonths​(java.lang.Integer cumulativeMonths)
    How many months in total has the receiving user been subscribed
    void setDisplayName​(java.lang.String displayName)
    The display name for the user that purchased the subscription
    void setIsGift​(java.lang.Boolean isGift)
    Whether this sub message was caused by a gift subscription
    void setMonths​(java.lang.Integer months)
    Deprecated.
    void setMultiMonthDuration​(java.lang.Integer multiMonthDuration)
    Number of months gifted as part of a single, multi-month gift
    void setRecipientDisplayName​(java.lang.String recipientDisplayName)  
    void setRecipientId​(java.lang.String recipientId)  
    void setRecipientUserName​(java.lang.String recipientUserName)  
    void setStreakMonths​(java.lang.Integer streakMonths)
    How many months in a row has the receiving user been subscribed
    void setSubMessage​(CommerceMessage subMessage)
    The accompanying message when the subscription was shared
    void setSubPlan​(com.github.twitch4j.common.enums.SubscriptionPlan subPlan)
    The type of subscription plan that was purchased
    void setSubPlanName​(java.lang.String subPlanName)
    The name of the subscription plan that was purchased
    void setTimestamp​(java.time.Instant timestamp)
    RFC 3339 timestamp of when the subscription took place
    void setUserId​(java.lang.String userId)
    The id for the user that purchased the subscription
    void setUserName​(java.lang.String userName)
    The login name for the user that purchased the subscription
    java.lang.String toString()  

    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

      public CommerceMessage 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

      public void setSubMessage​(CommerceMessage subMessage)
      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:
      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