Passed
Push — master ( 482350...d5f627 )
by Roannel Fernández
03:16
created

execute(Update,String[])

Size

Total Lines 1
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 1
c 0
b 0
f 0
1
package com.github.netkorp.telegram.framework.commands.interfaces;
2
3
import org.telegram.telegrambots.meta.api.objects.Update;
4
5
/**
6
 * Contains the logic of a simple command. In addition, it could be used to identify the simple command.
7
 *
8
 * @see MultistageCommand
9
 */
10
public interface SimpleCommand extends Command {
11
12
    /**
13
     * Executes the command's logic taking parameters.
14
     *
15
     * @param update the received message.
16
     * @param args   the parameters passed to the command execution.
17
     */
18
    void execute(final Update update, String[] args);
19
20
    /**
21
     * Executes the command's logic without taking parameters.
22
     *
23
     * @param update the received message.
24
     */
25
    default void execute(final Update update) {
26
        this.execute(update, new String[]{});
27
    }
28
}
29