Interface CommandCallbackDataMapper
public interface CommandCallbackDataMapper
Mapper interface for converting Telegram command callback data to application-specific command callback data DTOs.
-
Method Summary
Modifier and TypeMethodDescriptiondoMap(PostControlsSendMessageProperties.InlineKeyboardMarkupProperties.InlineKeyboardButtonProperties ikbp, List<org.telegram.telegrambots.meta.api.objects.message.Message> messages) Internal mapping method to createCommandCallbackDatafrom button properties and messages.getMessageIds(RawCommandCallbackData callbackData) Generates a list of message IDs based on the first message ID and message count.default intgetSize(Collection<?> collection) Gets the size of a collection safely.default CommandCallbackDatamap(PostControlsSendMessageProperties.InlineKeyboardMarkupProperties.InlineKeyboardButtonProperties ikbp, List<org.telegram.telegrambots.meta.api.objects.message.Message> messages) Maps inline keyboard button properties and associated messages toCommandCallbackData.map(CommandCallbackData callbackData) ConvertsCommandCallbackDatatoRawCommandCallbackData.map(RawCommandCallbackData callbackData) default Integermap(org.telegram.telegrambots.meta.api.objects.message.Message message) Maps aMessageto its message ID.
-
Method Details
-
map
ConvertsCommandCallbackDatatoRawCommandCallbackData.- Parameters:
callbackData- the command callback data to convert- Returns:
- the raw command callback data
-
map
- Parameters:
callbackData- the raw command callback data to map- Returns:
- the command callback data
-
map
default CommandCallbackData map(PostControlsSendMessageProperties.InlineKeyboardMarkupProperties.InlineKeyboardButtonProperties ikbp, List<org.telegram.telegrambots.meta.api.objects.message.Message> messages) Maps inline keyboard button properties and associated messages toCommandCallbackData.- Parameters:
ikbp- the inline keyboard button propertiesmessages- the list of messages associated with the button- Returns:
- the command callback data
-
map
Maps aMessageto its message ID.- Parameters:
message- the message to map- Returns:
- the message ID
-
doMap
CommandCallbackData doMap(PostControlsSendMessageProperties.InlineKeyboardMarkupProperties.InlineKeyboardButtonProperties ikbp, List<org.telegram.telegrambots.meta.api.objects.message.Message> messages) Internal mapping method to createCommandCallbackDatafrom button properties and messages.- Parameters:
ikbp- the inline keyboard button propertiesmessages- the list of messages associated with the button- Returns:
- the command callback data
-
getSize
Gets the size of a collection safely.- Parameters:
collection- the collection to get the size of- Returns:
- the size of the collection, or
0if the collection isnull
-
getMessageIds
Generates a list of message IDs based on the first message ID and message count.- Parameters:
callbackData- the raw command callback data containing the first message ID and message count- Returns:
- the list of message IDs
-