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 videowidth
- the width of the image or videoheight
- the height of the image or videogif
- the GIF variant, if availablemp4
- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(Link.Resolution resolution) final boolean
Indicates whether some other object is "equal to" this one.gif()
Returns the value of thegif
record component.final int
hashCode()
Returns a hash code value for this object.height()
Returns the value of theheight
record component.mp4()
Returns the value of themp4
record component.final String
toString()
Returns a string representation of this record class.url()
Returns the value of theurl
record component.width()
Returns the value of thewidth
record component.
-
Constructor Details
-
Resolution
Creates an instance of aResolution
record class.
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Link.Resolution>
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
. -
url
Returns the value of theurl
record component.- Returns:
- the value of the
url
record component
-
width
Returns the value of thewidth
record component.- Returns:
- the value of the
width
record component
-
height
Returns the value of theheight
record component.- Returns:
- the value of the
height
record component
-
gif
Returns the value of thegif
record component.- Returns:
- the value of the
gif
record component
-
mp4
Returns the value of themp4
record component.- Returns:
- the value of the
mp4
record component
-