Record Class Link.Variants

java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.reddit.dto.Link.Variants
Record Components:
gif - the GIF variant, if available
mp3 - the MP3 variant, if available
mp4 - the MP4 variant, if available
nsfw - the NSFW variant, if available
obfuscated - the obfuscated variant, if available
Enclosing class:
Link

public static record Link.Variants(Link.Variant gif, Link.Variant mp3, Link.Variant mp4, Link.Variant nsfw, Link.Variant obfuscated) extends Record
Represents the variants of a post's media.
  • Constructor Details

    • Variants

      public Variants(Link.Variant gif, Link.Variant mp3, Link.Variant mp4, Link.Variant nsfw, Link.Variant obfuscated)
      Creates an instance of a Variants record class.
      Parameters:
      gif - the value for the gif record component
      mp3 - the value for the mp3 record component
      mp4 - the value for the mp4 record component
      nsfw - the value for the nsfw record component
      obfuscated - the value for the obfuscated record component
  • Method Details

    • hasGif

      public boolean hasGif()
      Checks if the post has a GIF variant.
      Returns:
      true if the post has a GIF variant, false otherwise.
    • 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.
    • gif

      public Link.Variant gif()
      Returns the value of the gif record component.
      Returns:
      the value of the gif record component
    • mp3

      public Link.Variant mp3()
      Returns the value of the mp3 record component.
      Returns:
      the value of the mp3 record component
    • mp4

      public Link.Variant mp4()
      Returns the value of the mp4 record component.
      Returns:
      the value of the mp4 record component
    • nsfw

      public Link.Variant nsfw()
      Returns the value of the nsfw record component.
      Returns:
      the value of the nsfw record component
    • obfuscated

      public Link.Variant obfuscated()
      Returns the value of the obfuscated record component.
      Returns:
      the value of the obfuscated record component