Record Class TelegramProperties
java.lang.Object
java.lang.Record
io.github.yvasyliev.telegramforwarderbot.configuration.TelegramProperties
- Record Components:
adminId
- ID of the admin userchannelUsername
- username of the Telegram channelmaxPhotoDimensions
- maximum dimensions for photos in pixelsmediaGroupMaxSize
- maximum size of media groupsbot
- bot configuration including token and versionpostControls
- controls for posting messages and buttonsradix
- radix for number formatting- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Configuration for the Telegram Bot.static final record
Configuration for post controls. -
Constructor Summary
ConstructorsConstructorDescriptionTelegramProperties
(@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) Creates an instance of aTelegramProperties
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Long
adminId()
Returns the value of theadminId
record component.@NotNull TelegramProperties.Bot
bot()
Returns the value of thebot
record component.@NotBlank String
Returns the value of thechannelUsername
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.@NotNull Integer
Returns the value of themaxPhotoDimensions
record component.@NotNull Integer
Returns the value of themediaGroupMaxSize
record component.@NotNull TelegramProperties.PostControls
Returns the value of thepostControls
record component.@NotNull Integer
radix()
Returns the value of theradix
record component.final String
toString()
Returns a string representation of this record class.@NotBlank String
Returns the value of theunauthorizedActionText
record component.
-
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 aTelegramProperties
record class.- Parameters:
adminId
- the value for theadminId
record componentchannelUsername
- the value for thechannelUsername
record componentmaxPhotoDimensions
- the value for themaxPhotoDimensions
record componentmediaGroupMaxSize
- the value for themediaGroupMaxSize
record componentbot
- the value for thebot
record componentpostControls
- the value for thepostControls
record componentradix
- the value for theradix
record componentunauthorizedActionText
- the value for theunauthorizedActionText
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)
. -
adminId
Returns the value of theadminId
record component.- Returns:
- the value of the
adminId
record component
-
channelUsername
Returns the value of thechannelUsername
record component.- Returns:
- the value of the
channelUsername
record component
-
maxPhotoDimensions
Returns the value of themaxPhotoDimensions
record component.- Returns:
- the value of the
maxPhotoDimensions
record component
-
mediaGroupMaxSize
Returns the value of themediaGroupMaxSize
record component.- Returns:
- the value of the
mediaGroupMaxSize
record component
-
bot
Returns the value of thebot
record component.- Returns:
- the value of the
bot
record component
-
postControls
Returns the value of thepostControls
record component.- Returns:
- the value of the
postControls
record component
-
radix
Returns the value of theradix
record component.- Returns:
- the value of the
radix
record component
-
unauthorizedActionText
Returns the value of theunauthorizedActionText
record component.- Returns:
- the value of the
unauthorizedActionText
record component
-