All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pro.zackpollard.telegrambot.api.menu.button.builder.BackButtonBuilder Maven / Gradle / Ivy

There is a newer version: 1.6.5
Show newest version
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