Record Class InputMediaDTO

java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.dto.InputMediaDTO
Record Components:
type - the type of the media
inputFile - the input file associated with the media

public record InputMediaDTO(InputMediaDTO.Type type, InputFileDTO inputFile) extends Record
Data Transfer Object for input media used in Telegram. It can represent different types of media such as animation, photo, or video.
  • Constructor Details

    • InputMediaDTO

      public InputMediaDTO(InputMediaDTO.Type type, InputFileDTO inputFile)
      Creates an instance of a InputMediaDTO record class.
      Parameters:
      type - the value for the type record component
      inputFile - the value for the inputFile record component
  • Method Details

    • animation

      public static InputMediaDTO animation(InputFileDTO animation)
      Creates an InputMediaDTO for an animation.
      Parameters:
      animation - the input file representing the animation
      Returns:
      a new InputMediaDTO instance for the animation
    • photo

      public static InputMediaDTO photo(InputFileDTO photo)
      Creates an InputMediaDTO for a photo.
      Parameters:
      photo - the input file representing the photo
      Returns:
      a new InputMediaDTO instance for the photo
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public InputMediaDTO.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • inputFile

      public InputFileDTO inputFile()
      Returns the value of the inputFile record component.
      Returns:
      the value of the inputFile record component