-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCLIOption.java
42 lines (30 loc) · 1.09 KB
/
CLIOption.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class CLIOption {
private String name;
private boolean hasArg;
private String description;
private boolean required;
public CLIOption(String name, boolean hasArg, String description) {
this.name = name;
this.hasArg = hasArg;
this.description = description;
required = true;
}
public CLIOption(String name, boolean hasArg, String description, boolean required) {
this.name = name;
this.hasArg = hasArg;
this.description = description;
this.required = required;
}
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public boolean hasArg() { return hasArg; }
public void setHasArg(boolean hasArg) { this.hasArg = hasArg; }
public String getDescription() { return description; }
public void setDescription(String description) { this.description = description; }
public boolean isRequired() { return required; }
public void setRequired(boolean required) { this.required = required; }
@Override
public String toString() {
return "\t-" + name + (hasArg ? " <arg> " : " ") + ": " + description;
}
}