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

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;
0 ignored issues
show
Code Smell introduced by
It is a best practice to supply a copyright/licence header in your code. Your organisation probably has a template for that.
Loading history...
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 {
0 ignored issues
show
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
Java 8 introduced by
Annotate the "SimpleCommand" interface with the @FunctionalInterface annotation
Loading history...
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);
0 ignored issues
show
Coding Style introduced by
Make this line start at column 3.
Loading history...
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) {
0 ignored issues
show
Coding Style introduced by
Move this left curly brace to the beginning of next line of code.
Loading history...
26
        this.execute(update, new String[]{});
0 ignored issues
show
Coding Style introduced by
Make this line start at column 5.
Loading history...
27
    }
28
}
29