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

ru.codeoff.bots.keyboard.Keyboard Maven / Gradle / Ivy

package ru.codeoff.bots.keyboard;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import org.json.JSONArray;
import org.json.JSONObject;

/**
 * The type Keyboard.
 */
public class Keyboard {

    private static final int MAX_BUTTONS_IN_LINES = 4;

    private static final int MAX_LINES = 10;

    private static final int MAX_BUTTONS = 40;

    private boolean one_time = false;

    private boolean inline = false;

    private List> buttonsLines = new ArrayList();


    /**
     * Sets one time.
     *
     * @param value the value
     * @return the one time
     */
    public Keyboard setOneTime(boolean value) {
        this.one_time = value;
        return this;
    }

    /**
     * Sets inline.
     *
     * @param value the value
     * @return the inline
     */
    public Keyboard setInline(boolean value) {
        this.inline = value;
        return this;
    }

    /**
     * Add buttons line keyboard.
     *
     * @param buttons the buttons
     * @return the keyboard
     */
    public Keyboard addButtonsLine(List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy