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 recordConfiguration for the Telegram Bot.static final recordConfiguration 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 aTelegramPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull LongadminId()Returns the value of theadminIdrecord component.@NotNull TelegramProperties.Botbot()Returns the value of thebotrecord component.@NotBlank StringReturns the value of thechannelUsernamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull IntegerReturns the value of themaxPhotoDimensionsrecord component.@NotNull IntegerReturns the value of themediaGroupMaxSizerecord component.@NotNull TelegramProperties.PostControlsReturns the value of thepostControlsrecord component.@NotNull Integerradix()Returns the value of theradixrecord component.final StringtoString()Returns a string representation of this record class.@NotBlank StringReturns the value of theunauthorizedActionTextrecord 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 aTelegramPropertiesrecord class.- Parameters:
adminId- the value for theadminIdrecord componentchannelUsername- the value for thechannelUsernamerecord componentmaxPhotoDimensions- the value for themaxPhotoDimensionsrecord componentmediaGroupMaxSize- the value for themediaGroupMaxSizerecord componentbot- the value for thebotrecord componentpostControls- the value for thepostControlsrecord componentradix- the value for theradixrecord componentunauthorizedActionText- the value for theunauthorizedActionTextrecord 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 theadminIdrecord component.- Returns:
- the value of the
adminIdrecord component
-
channelUsername
Returns the value of thechannelUsernamerecord component.- Returns:
- the value of the
channelUsernamerecord component
-
maxPhotoDimensions
Returns the value of themaxPhotoDimensionsrecord component.- Returns:
- the value of the
maxPhotoDimensionsrecord component
-
mediaGroupMaxSize
Returns the value of themediaGroupMaxSizerecord component.- Returns:
- the value of the
mediaGroupMaxSizerecord component
-
bot
Returns the value of thebotrecord component.- Returns:
- the value of the
botrecord component
-
postControls
Returns the value of thepostControlsrecord component.- Returns:
- the value of the
postControlsrecord component
-
radix
Returns the value of theradixrecord component.- Returns:
- the value of the
radixrecord component
-
unauthorizedActionText
Returns the value of theunauthorizedActionTextrecord component.- Returns:
- the value of the
unauthorizedActionTextrecord component
-