make SuggestionProvider use CompletableFuture
This commit is contained in:
parent
35709b702d
commit
c2aec2842a
5 changed files with 11 additions and 6 deletions
|
|
@ -3,8 +3,9 @@ package de.kentoj.kencommandapi.api.structure.argument;
|
|||
import de.kentoj.kencommandapi.api.processing.CommandContext;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public interface SuggestionProvider<T, S extends CommandContext<T, ?>> {
|
||||
|
||||
Set<String> suggest(S context);
|
||||
CompletableFuture<Set<String>> suggest(S context);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@ package de.kentoj.kencommandapi.api.structure.argument.suggestion;
|
|||
import de.kentoj.kencommandapi.api.processing.CommandContext;
|
||||
import de.kentoj.kencommandapi.api.structure.argument.SuggestionProvider;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class NoSuggestionProvider<T, S extends CommandContext<T, ?>> implements SuggestionProvider<T, S> {
|
||||
|
||||
@Override
|
||||
public Set<String> suggest(S context) {
|
||||
return Set.of();
|
||||
public CompletableFuture<Set<String>> suggest(S ctx) {
|
||||
return CompletableFuture.completedFuture(Collections.emptySet());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue