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 availablemp3
- the MP3 variant, if availablemp4
- the MP4 variant, if availablensfw
- the NSFW variant, if availableobfuscated
- 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 Summary
ConstructorsConstructorDescriptionVariants
(Link.Variant gif, Link.Variant mp3, Link.Variant mp4, Link.Variant nsfw, Link.Variant obfuscated) Creates an instance of aVariants
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.gif()
Returns the value of thegif
record component.boolean
hasGif()
Checks if the post has a GIF variant.final int
hashCode()
Returns a hash code value for this object.mp3()
Returns the value of themp3
record component.mp4()
Returns the value of themp4
record component.nsfw()
Returns the value of thensfw
record component.Returns the value of theobfuscated
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Variants
public Variants(Link.Variant gif, Link.Variant mp3, Link.Variant mp4, Link.Variant nsfw, Link.Variant obfuscated) Creates an instance of aVariants
record class.- Parameters:
gif
- the value for thegif
record componentmp3
- the value for themp3
record componentmp4
- the value for themp4
record componentnsfw
- the value for thensfw
record componentobfuscated
- the value for theobfuscated
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
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)
. -
gif
Returns the value of thegif
record component.- Returns:
- the value of the
gif
record component
-
mp3
Returns the value of themp3
record component.- Returns:
- the value of the
mp3
record component
-
mp4
Returns the value of themp4
record component.- Returns:
- the value of the
mp4
record component
-
nsfw
Returns the value of thensfw
record component.- Returns:
- the value of the
nsfw
record component
-
obfuscated
Returns the value of theobfuscated
record component.- Returns:
- the value of the
obfuscated
record component
-