Record Class TelegramProperties

java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.configuration.TelegramProperties
Record Components:
adminId - ID of the admin user
channelUsername - username of the Telegram channel
maxPhotoDimensions - maximum dimensions for photos in pixels
mediaGroupMaxSize - maximum size of media groups
bot - bot configuration including token and version
postControls - controls for posting messages and buttons
radix - radix for number formatting
unauthorizedActionText - text displayed when an unauthorized action is attempted

@ConfigurationProperties(prefix="telegram") @Validated public record TelegramProperties(@NotNull Long adminId, @NotBlank String channelUsername, @NotNull Integer maxPhotoDimensions, @NotNull Integer mediaGroupMaxSize, @NotNull TelegramProperties.Bot bot, @NotNull TelegramProperties.PostControls postControls, @NotNull Integer radix, @NotBlank String unauthorizedActionText) extends Record
Configuration properties for the Telegram Forwarder Bot.
  • Constructor Details

    • TelegramProperties

      public TelegramProperties(@NotNull @NotNull Long adminId, @NotBlank @NotBlank String channelUsername, @DefaultValue("10_000") @NotNull @NotNull Integer maxPhotoDimensions, @DefaultValue("10") @NotNull @NotNull Integer mediaGroupMaxSize, @Validated @NotNull @NotNull TelegramProperties.Bot bot, @Validated @NotNull @NotNull TelegramProperties.PostControls postControls, @DefaultValue("36") @NotNull @NotNull Integer radix, @NotBlank @NotBlank String unauthorizedActionText)
      Creates an instance of a TelegramProperties record class.
      Parameters:
      adminId - the value for the adminId record component
      channelUsername - the value for the channelUsername record component
      maxPhotoDimensions - the value for the maxPhotoDimensions record component
      mediaGroupMaxSize - the value for the mediaGroupMaxSize record component
      bot - the value for the bot record component
      postControls - the value for the postControls record component
      radix - the value for the radix record component
      unauthorizedActionText - the value for the unauthorizedActionText record component
  • Method Details

    • 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.
    • adminId

      @NotNull public @NotNull Long adminId()
      Returns the value of the adminId record component.
      Returns:
      the value of the adminId record component
    • channelUsername

      @NotBlank public @NotBlank String channelUsername()
      Returns the value of the channelUsername record component.
      Returns:
      the value of the channelUsername record component
    • maxPhotoDimensions

      @NotNull public @NotNull Integer maxPhotoDimensions()
      Returns the value of the maxPhotoDimensions record component.
      Returns:
      the value of the maxPhotoDimensions record component
    • mediaGroupMaxSize

      @NotNull public @NotNull Integer mediaGroupMaxSize()
      Returns the value of the mediaGroupMaxSize record component.
      Returns:
      the value of the mediaGroupMaxSize record component
    • bot

      @Validated @NotNull public @NotNull TelegramProperties.Bot bot()
      Returns the value of the bot record component.
      Returns:
      the value of the bot record component
    • postControls

      @Validated @NotNull public @NotNull TelegramProperties.PostControls postControls()
      Returns the value of the postControls record component.
      Returns:
      the value of the postControls record component
    • radix

      @NotNull public @NotNull Integer radix()
      Returns the value of the radix record component.
      Returns:
      the value of the radix record component
    • unauthorizedActionText

      @NotBlank public @NotBlank String unauthorizedActionText()
      Returns the value of the unauthorizedActionText record component.
      Returns:
      the value of the unauthorizedActionText record component