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

com.github.netkorp.telegram.framework.commands.interfaces.SimpleCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 17
rs 10
c 1
b 0
f 0
wmc 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute(Update) 0 2 1
execute(Update,String[]) 0 1 ?
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