Record Class Link.Resolution

java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.reddit.dto.Link.Resolution
Record Components:
url - the URL of the image or video
width - the width of the image or video
height - the height of the image or video
gif - the GIF variant, if available
mp4 - the MP4 variant, if available
All Implemented Interfaces:
Comparable<Link.Resolution>
Enclosing class:
Link

public static record Link.Resolution(URL url, Integer width, Integer height, URL gif, URL mp4) extends Record implements Comparable<Link.Resolution>
Represents a resolution of an image or video.
  • Constructor Details

    • Resolution

      public Resolution(URL url, Integer width, Integer height, URL gif, URL mp4)
      Creates an instance of a Resolution record class.
      Parameters:
      url - the value for the url record component
      width - the value for the width record component
      height - the value for the height record component
      gif - the value for the gif record component
      mp4 - the value for the mp4 record component
  • Method Details

    • compareTo

      public int compareTo(Link.Resolution resolution)
      Specified by:
      compareTo in interface Comparable<Link.Resolution>
    • 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.
    • url

      public URL url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • width

      public Integer width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public Integer height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • gif

      public URL gif()
      Returns the value of the gif record component.
      Returns:
      the value of the gif record component
    • mp4

      public URL mp4()
      Returns the value of the mp4 record component.
      Returns:
      the value of the mp4 record component