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 aVariantsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.gif()Returns the value of thegifrecord component.booleanhasGif()Checks if the post has a GIF variant.final inthashCode()Returns a hash code value for this object.mp3()Returns the value of themp3record component.mp4()Returns the value of themp4record component.nsfw()Returns the value of thensfwrecord component.Returns the value of theobfuscatedrecord component.final StringtoString()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 aVariantsrecord class.- Parameters:
gif- the value for thegifrecord componentmp3- the value for themp3record componentmp4- the value for themp4record componentnsfw- the value for thensfwrecord componentobfuscated- the value for theobfuscatedrecord component
-
-
Method Details
-
hasGif
public boolean hasGif()Checks if the post has a GIF variant.- Returns:
trueif the post has a GIF variant,falseotherwise.
-
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 thegifrecord component.- Returns:
- the value of the
gifrecord component
-
mp3
Returns the value of themp3record component.- Returns:
- the value of the
mp3record component
-
mp4
Returns the value of themp4record component.- Returns:
- the value of the
mp4record component
-
nsfw
Returns the value of thensfwrecord component.- Returns:
- the value of the
nsfwrecord component
-
obfuscated
Returns the value of theobfuscatedrecord component.- Returns:
- the value of the
obfuscatedrecord component
-