Record Class Subscription

java.lang.Object
java.lang.Record
org.mastodon4j.core.api.entities.Subscription

public record Subscription(String access_token, String type, String stream, String list, String tag) extends Record
  • Constructor Details

    • Subscription

      public Subscription(String access_token, String type, String stream, String list, String tag)
      Creates an instance of a Subscription record class.
      Parameters:
      access_token - the value for the access_token record component
      type - the value for the type record component
      stream - the value for the stream record component
      list - the value for the list record component
      tag - the value for the tag record component
  • Method Details

    • stream

      public static Subscription stream(boolean subscribe, AccessToken accessToken, String stream)
      Create a stream subscription using the following parameters.
      Parameters:
      subscribe - true subscribe, false unsubscribe
      accessToken - the access token
      stream - the stream name
    • hashtag

      public static Subscription hashtag(boolean subscribe, AccessToken accessToken, String tag)
      Create a hashtag subscription using the following parameters.
      Parameters:
      subscribe - true subscribe, false unsubscribe
      accessToken - the access token
      tag - the optional hash stream tag
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • access_token

      public String access_token()
      Returns the value of the access_token record component.
      Returns:
      the value of the access_token record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • stream

      public String stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component
    • list

      public String list()
      Returns the value of the list record component.
      Returns:
      the value of the list record component
    • tag

      public String tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component