47 lines
923 B
Java
47 lines
923 B
Java
package game.command;
|
|
|
|
import java.util.List;
|
|
|
|
public class Parameter {
|
|
private final String name;
|
|
private final char shortName;
|
|
private final boolean required;
|
|
private final int position;
|
|
private final List<ArgumentParser> parsers;
|
|
|
|
public Parameter(String name, char shortName, int position, boolean required, List<ArgumentParser> parsers) {
|
|
this.name = name;
|
|
this.shortName = shortName;
|
|
this.position = position;
|
|
this.required = required;
|
|
this.parsers = parsers;
|
|
}
|
|
|
|
public boolean isPositional() {
|
|
return this.position > 0;
|
|
}
|
|
|
|
public int getPosition() {
|
|
return this.position;
|
|
}
|
|
|
|
public List<ArgumentParser> getParsers() {
|
|
return this.parsers;
|
|
}
|
|
|
|
public boolean isRequired() {
|
|
return this.required;
|
|
}
|
|
|
|
public String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
public boolean hasShortName() {
|
|
return this.shortName != 0;
|
|
}
|
|
|
|
public char getShortName() {
|
|
return this.shortName;
|
|
}
|
|
}
|