Allow changing of a source after creation of a contextbuilder

This commit is contained in:
Nathan Adams 2017-06-28 11:08:26 +02:00
parent e6b78a5f2a
commit 7d4dcc3e4b

View file

@ -9,13 +9,18 @@ import java.util.Map;
public class CommandContextBuilder<S> {
private final Map<String, ParsedArgument<?>> arguments = Maps.newHashMap();
private final Map<CommandNode<S>, String> nodes = Maps.newLinkedHashMap();
private final S source;
private S source;
private Command<S> command;
public CommandContextBuilder(S source) {
this.source = source;
}
public CommandContextBuilder<S> withSource(S source) {
this.source = source;
return this;
}
public S getSource() {
return source;
}