Removed unused copy methods, no longer needed

This commit is contained in:
Nathan Adams 2017-07-27 11:00:35 +02:00
parent 5181559f46
commit 152c0b09d1
4 changed files with 1 additions and 15 deletions

View file

@ -79,9 +79,4 @@ public class CommandContext<S> {
return nodes;
}
public CommandContext<S> copy() {
final Map<String, ParsedArgument<S, ?>> arguments = Maps.newLinkedHashMap();
this.arguments.forEach((k, v) -> arguments.put(k, v.copy()));
return new CommandContext<>(source, arguments, command, nodes, input);
}
}

View file

@ -55,7 +55,7 @@ public class CommandContextBuilder<S> {
public CommandContextBuilder<S> copy() {
final CommandContextBuilder<S> copy = new CommandContextBuilder<>(dispatcher, source);
copy.command = this.command;
arguments.forEach((k, v) -> copy.arguments.put(k, v.copy()));
copy.arguments.putAll(arguments);
copy.nodes.putAll(this.nodes);
copy.input.append(input);
return copy;

View file

@ -37,7 +37,4 @@ public class ParsedArgument<S, T> {
return result;
}
public ParsedArgument<S, T> copy() {
return new ParsedArgument<>(raw, result);
}
}

View file

@ -16,10 +16,4 @@ public class ParsedArgumentTest {
.addEqualityGroup(new ParsedArgument<>("foo", "baz"), new ParsedArgument<>("foo", "baz"))
.testEquals();
}
@Test
public void copy() throws Exception {
final ParsedArgument<Object, String> argument = new ParsedArgument<>("foo", "bar");
assertThat(argument.copy(), is(equalTo(argument)));
}
}