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 record
Represents an image in the preview. -
Constructor Summary
ConstructorsConstructorDescriptionPreview
(List<Link.Preview.Image> images, Boolean enabled, Link.RedditVideo redditVideoPreview) Creates an instance of aPreview
record class. -
Method Summary
Modifier and TypeMethodDescriptionenabled()
Returns the value of theenabled
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.images()
Returns the value of theimages
record component.Returns the value of theredditVideoPreview
record component.final String
toString()
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 aPreview
record class.- Parameters:
images
- the value for theimages
record componentenabled
- the value for theenabled
record componentredditVideoPreview
- the value for theredditVideoPreview
record 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 theimages
record component.- Returns:
- the value of the
images
record component
-
enabled
Returns the value of theenabled
record component.- Returns:
- the value of the
enabled
record component
-
redditVideoPreview
Returns the value of theredditVideoPreview
record component.- Returns:
- the value of the
redditVideoPreview
record component
-