Refactored name of command builder, to specify it a little better

This commit is contained in:
Tim Visée 2015-12-01 16:14:59 +01:00
parent 00c6b17f3e
commit 3b9b1b7b8a
2 changed files with 14 additions and 14 deletions

View File

@ -735,11 +735,11 @@ public class CommandDescription {
this.permissions = new CommandPermissions(permissionNode, defaultPermission); this.permissions = new CommandPermissions(permissionNode, defaultPermission);
} }
public static Builder builder() { public static CommandBuilder builder() {
return new Builder(); return new CommandBuilder();
} }
public static final class Builder { public static final class CommandBuilder {
private List<String> labels; private List<String> labels;
private String description; private String description;
private String detailedDescription; private String detailedDescription;
@ -767,47 +767,47 @@ public class CommandDescription {
); );
} }
public Builder labels(List<String> labels) { public CommandBuilder labels(List<String> labels) {
this.labels = labels; this.labels = labels;
return this; return this;
} }
public Builder labels(String... labels) { public CommandBuilder labels(String... labels) {
return labels(asMutableList(labels)); return labels(asMutableList(labels));
} }
public Builder description(String description) { public CommandBuilder description(String description) {
this.description = description; this.description = description;
return this; return this;
} }
public Builder detailedDescription(String detailedDescription) { public CommandBuilder detailedDescription(String detailedDescription) {
this.detailedDescription = detailedDescription; this.detailedDescription = detailedDescription;
return this; return this;
} }
public Builder executableCommand(ExecutableCommand executableCommand) { public CommandBuilder executableCommand(ExecutableCommand executableCommand) {
this.executableCommand = executableCommand; this.executableCommand = executableCommand;
return this; return this;
} }
public Builder parent(CommandDescription parent) { public CommandBuilder parent(CommandDescription parent) {
this.parent = parent; this.parent = parent;
return this; return this;
} }
public Builder withArgument(String label, String description, boolean isOptional) { public CommandBuilder withArgument(String label, String description, boolean isOptional) {
arguments.add(new CommandArgumentDescription(label, description, isOptional)); arguments.add(new CommandArgumentDescription(label, description, isOptional));
return this; return this;
} }
public Builder noArgumentMaximum(boolean noArgumentMaximum) { public CommandBuilder noArgumentMaximum(boolean noArgumentMaximum) {
this.noArgumentMaximum = noArgumentMaximum; this.noArgumentMaximum = noArgumentMaximum;
return this; return this;
} }
public Builder permissions(CommandPermissions.DefaultPermission defaultPermission, public CommandBuilder permissions(CommandPermissions.DefaultPermission defaultPermission,
PermissionNode... permissionNodes) { PermissionNode... permissionNodes) {
this.permissions = new CommandPermissions(asMutableList(permissionNodes), defaultPermission); this.permissions = new CommandPermissions(asMutableList(permissionNodes), defaultPermission);
return this; return this;
} }

View File

@ -131,7 +131,7 @@ public class HelpSyntaxHelperTest {
} }
private static CommandDescription.Builder getDescriptionBuilder() { private static CommandDescription.CommandBuilder getDescriptionBuilder() {
CommandDescription base = CommandDescription.builder() CommandDescription base = CommandDescription.builder()
.labels("authme") .labels("authme")
.description("Base command") .description("Base command")