tcr/java/src/game/command/Parameter.java

48 lines
923 B
Java
Raw Normal View History

2025-03-11 00:23:54 +01:00
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;
}
}