Record Class InputMediaDTO
java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.dto.InputMediaDTO
- Record Components:
type
- the type of the mediainputFile
- the input file associated with the media
Data Transfer Object for input media used in Telegram.
It can represent different types of media such as animation, photo, or video.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Types of media that can be represented in anInputMediaDTO
. -
Constructor Summary
ConstructorsConstructorDescriptionInputMediaDTO
(InputMediaDTO.Type type, InputFileDTO inputFile) Creates an instance of aInputMediaDTO
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic InputMediaDTO
animation
(InputFileDTO animation) Creates anInputMediaDTO
for an animation.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinputFile
record component.static InputMediaDTO
photo
(InputFileDTO photo) Creates anInputMediaDTO
for a photo.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
Method Details
-
animation
Creates anInputMediaDTO
for an animation.- Parameters:
animation
- the input file representing the animation- Returns:
- a new
InputMediaDTO
instance for the animation
-
photo
Creates anInputMediaDTO
for a photo.- Parameters:
photo
- the input file representing the photo- Returns:
- a new
InputMediaDTO
instance for the photo
-
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)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
inputFile
Returns the value of theinputFile
record component.- Returns:
- the value of the
inputFile
record component
-