Record Class Link.Preview
java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.reddit.dto.Link.Preview
- Record Components:
images- the list of images in the previewenabled- indicates if the preview is enabledredditVideoPreview- the Reddit video preview, if available
- Enclosing class:
Link
public static record Link.Preview(List<Link.Preview.Image> images, Boolean enabled, Link.RedditVideo redditVideoPreview)
extends Record
Represents the preview data for a Reddit post.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents an image in the preview. -
Constructor Summary
ConstructorsConstructorDescriptionPreview(List<Link.Preview.Image> images, Boolean enabled, Link.RedditVideo redditVideoPreview) Creates an instance of aPreviewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.images()Returns the value of theimagesrecord component.Returns the value of theredditVideoPreviewrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Preview
public Preview(List<Link.Preview.Image> images, Boolean enabled, Link.RedditVideo redditVideoPreview) Creates an instance of aPreviewrecord class.- Parameters:
images- the value for theimagesrecord componentenabled- the value for theenabledrecord componentredditVideoPreview- the value for theredditVideoPreviewrecord component
-
-
Method Details
-
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). -
images
Returns the value of theimagesrecord component.- Returns:
- the value of the
imagesrecord component
-
enabled
Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
redditVideoPreview
Returns the value of theredditVideoPreviewrecord component.- Returns:
- the value of the
redditVideoPreviewrecord component
-