Class TwitchWebhookTopic<T>

java.lang.Object
com.github.twitch4j.helix.webhooks.topics.TwitchWebhookTopic<T>
Direct Known Subclasses:
ChannelBanTopic, ChannelSubscriptionTopic, ExtensionTransactionsTopic, FollowsTopic, HypeTrainTopic, ModeratorChangeTopic, StreamsTopic, TwitchWebhookTopic.UnknownTopic, UsersTopic

public abstract class TwitchWebhookTopic<T>
extends java.lang.Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  TwitchWebhookTopic.UnknownTopic  
  • Constructor Summary

    Constructors
    Constructor Description
    TwitchWebhookTopic​(java.lang.String url, java.lang.Class<T> type)
    Create a new topic from an existing URL
    TwitchWebhookTopic​(java.lang.String path, java.lang.Class<T> type, java.util.SortedMap<java.lang.String,​java.lang.Object> queryParameters)
    Create a new topic starting with "https://api.twitch.tv/helix"
    TwitchWebhookTopic​(java.lang.String baseUrl, java.lang.String path, java.lang.Class<T> type, java.util.SortedMap<java.lang.String,​java.lang.Object> queryParameters)
    Override the base URL in case Twitch ever changes it or creates a new endpoint with a different URL.
  • Method Summary

    Modifier and Type Method Description
    protected boolean canEqual​(java.lang.Object other)  
    boolean equals​(java.lang.Object o)  
    static TwitchWebhookTopic<?> fromUrl​(java.lang.String url)  
    java.lang.Class<T> getType()
    The data class that notifications for this topic deserialize to
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

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

    • TwitchWebhookTopic

      public TwitchWebhookTopic​(java.lang.String path, java.lang.Class<T> type, java.util.SortedMap<java.lang.String,​java.lang.Object> queryParameters)
      Create a new topic starting with "https://api.twitch.tv/helix"
      Parameters:
      path - The path to the specific Helix API endpoint..
      type - The data class that notifications for this topic deserialize to.
      queryParameters - A list of the query parameters for this topic URL. Will be sorted alphabetically, so performance will be higher if it is already sorted.
    • TwitchWebhookTopic

      public TwitchWebhookTopic​(java.lang.String baseUrl, java.lang.String path, java.lang.Class<T> type, java.util.SortedMap<java.lang.String,​java.lang.Object> queryParameters)
      Override the base URL in case Twitch ever changes it or creates a new endpoint with a different URL.
      Parameters:
      baseUrl - The base URL of the endpoint.
      path - The path to the specific API endpoint.
      type - The data class that notifications for this topic deserialize to.
      queryParameters - A list of the query parameters for this topic URL. Will be sorted alphabetically, so performance will be higher if it is already sorted.
    • TwitchWebhookTopic

      public TwitchWebhookTopic​(java.lang.String url, java.lang.Class<T> type)
      Create a new topic from an existing URL
      Parameters:
      url - The URL representing this topic.
      type - The data class that notifications for this topic deserialize to.
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
      Returns:
      The URL associated with this topic
    • fromUrl

      public static TwitchWebhookTopic<?> fromUrl​(java.lang.String url) throws java.net.URISyntaxException
      Throws:
      java.net.URISyntaxException
    • 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
    • getType

      public java.lang.Class<T> getType()
      The data class that notifications for this topic deserialize to