blob: 8742b5de2154d9f7ace1f4082b554eedda99540f (
plain)
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
43
44
45
46
47
|
package bjc.utils.cli;
/**
* Generic implementation of a help topic
*
* @author ben
*
*/
public class GenericHelp implements ICommandHelp {
// The strings for this help topic
private String summary;
private String description;
/**
* Create a new help topic
*
* @param summary
* The summary of this help topic
* @param description
* The description of this help topic, or null if this help
* topic doesn't have a more detailed description
*/
public GenericHelp(String summary, String description) {
if (summary == null) {
throw new NullPointerException(
"Help summary must be non-null");
}
this.summary = summary;
this.description = description;
}
@Override
public String getDescription() {
if (description == null) {
return summary;
}
return description;
}
@Override
public String getSummary() {
return summary;
}
}
|