Record Class Link.Variants
java.lang.Object
java.lang.Record
io.github.yvasyliev.forwarder.telegram.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
-
hashCode
-
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
-
mp3
-
mp4
-
nsfw
-
obfuscated
Returns the value of theobfuscatedrecord component.- Returns:
- the value of the
obfuscatedrecord component
-