pro.zackpollard.telegrambot.api.menu.button.builder.BackButtonBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jtelegram-botapi Show documentation
Show all versions of jtelegram-botapi Show documentation
The Java Telegram Bot API is a wrapper for the Telegram HTTP Bot API
package pro.zackpollard.telegrambot.api.menu.button.builder;
import pro.zackpollard.telegrambot.api.menu.AbstractInlineMenuBuilder;
import pro.zackpollard.telegrambot.api.menu.InlineMenuRowBuilder;
import pro.zackpollard.telegrambot.api.menu.button.AbstractButtonBuilder;
import pro.zackpollard.telegrambot.api.menu.button.impl.BackButton;
import pro.zackpollard.telegrambot.api.utils.Utils;
/**
* Builder for BackButton
* @param menu builder type
* @see BackButton
* @author Mazen Kotb
*/
public class BackButtonBuilder
extends AbstractButtonBuilder, T> {
public BackButtonBuilder(InlineMenuRowBuilder parent, int index) {
super(parent, index);
}
public BackButtonBuilder(InlineMenuRowBuilder parent, int index, String text) {
super(parent, index, text);
}
@Override
protected BackButtonBuilder instance() {
return this;
}
@Override
public InlineMenuRowBuilder build() {
Utils.validateNotNull(text);
parent.internalAddButton(processButton(new BackButton(null, parent.rowIndex(), index, text)));
return parent;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy