File tree Expand file tree Collapse file tree 2 files changed +16
-22
lines changed
src/main/java/com/datasiqn/commandcore/command/builder Expand file tree Collapse file tree 2 files changed +16
-22
lines changed Original file line number Diff line number Diff line change 4
4
import com .datasiqn .resultapi .None ;
5
5
import com .datasiqn .resultapi .Result ;
6
6
import org .jetbrains .annotations .NotNull ;
7
+ import org .jetbrains .annotations .UnmodifiableView ;
7
8
8
- import java .util .ArrayList ;
9
- import java .util .HashSet ;
10
- import java .util .List ;
11
- import java .util .Set ;
9
+ import java .util .*;
12
10
import java .util .function .Consumer ;
13
11
import java .util .function .Function ;
14
12
@@ -71,9 +69,18 @@ public T executes(@NotNull Consumer<CommandContext> executor) {
71
69
return getThis ();
72
70
}
73
71
72
+ /**
73
+ * Gets all children nodes
74
+ * @return An unmodifiable view of all children nodes
75
+ */
76
+ @ UnmodifiableView
77
+ public @ NotNull Set <CommandNode <?>> getChildren () {
78
+ return Collections .unmodifiableSet (children );
79
+ }
80
+
74
81
/**
75
82
* Gets the executor
76
- * @return the executor
83
+ * @return The executor
77
84
*/
78
85
public Consumer <CommandContext > getExecutor () {
79
86
return executor ;
Original file line number Diff line number Diff line change 4
4
import com .datasiqn .commandcore .command .context .CommandContext ;
5
5
import com .datasiqn .resultapi .None ;
6
6
import com .datasiqn .resultapi .Result ;
7
- import org .jetbrains .annotations .Contract ;
8
7
import org .jetbrains .annotations .NotNull ;
9
- import org .jetbrains .annotations .Unmodifiable ;
10
- import org .jetbrains .annotations .UnmodifiableView ;
11
8
12
- import java .util .*;
9
+ import java .util .ArrayList ;
10
+ import java .util .Comparator ;
11
+ import java .util .List ;
13
12
import java .util .function .Function ;
14
13
import java .util .stream .Collectors ;
15
14
@@ -42,19 +41,7 @@ public abstract class CommandNode<This extends CommandNode<This>> extends Comman
42
41
* @return The tabcomplete
43
42
*/
44
43
@ NotNull
45
- public List <String > getTabComplete (@ NotNull CommandContext context ) {
46
- return new ArrayList <>();
47
- }
48
-
49
- /**
50
- * Gets the children of this node
51
- * @return A view of this node's children
52
- */
53
- @ Contract (" -> new" )
54
- @ UnmodifiableView
55
- public final @ NotNull @ Unmodifiable Set <CommandNode <?>> getChildren () {
56
- return Collections .unmodifiableSet (children );
57
- }
44
+ public abstract List <String > getTabComplete (@ NotNull CommandContext context );
58
45
59
46
/**
60
47
* Attempts to parse a string
You can’t perform that action at this time.
0 commit comments