@@ -46,28 +46,28 @@ public abstract class AbstractConsoleArgument extends
46
46
AbstractHandlerPlugin <LinkedList <String >> implements ConsoleArgument
47
47
{
48
48
private int numArgs ;
49
- private Set <String > aliasFlags ;
49
+ private Set <String > flags ;
50
50
51
51
public AbstractConsoleArgument () {
52
52
this (1 , new String [0 ]);
53
53
}
54
54
55
- public AbstractConsoleArgument (final String ... aliases ) {
56
- this (1 , aliases );
55
+ public AbstractConsoleArgument (final String ... flags ) {
56
+ this (1 , flags );
57
57
}
58
58
59
- public AbstractConsoleArgument (final int requiredArgs , final String ... aliases ) {
59
+ public AbstractConsoleArgument (final int requiredArgs , final String ... flags ) {
60
60
numArgs = requiredArgs ;
61
- aliasFlags = new HashSet <String >();
62
- for (final String s : aliases ) aliasFlags .add (s );
61
+ this . flags = new HashSet <String >();
62
+ for (final String s : flags ) this . flags .add (s );
63
63
}
64
64
65
65
// -- Typed methods --
66
66
67
67
@ Override
68
68
public boolean supports (final LinkedList <String > args ) {
69
69
if (args == null || args .size () < numArgs ) return false ;
70
- return isAlias (args );
70
+ return isFlag (args );
71
71
}
72
72
73
73
@ Override
@@ -77,11 +77,13 @@ public Class<LinkedList<String>> getType() {
77
77
}
78
78
79
79
/**
80
- * @return true if there are no aliases for this {@code ConsoleArgument}, or
81
- * at least one alias matches the first argument in the provided
82
- * list
80
+ * Check if the given list of arguments starts with a flag that matches this
81
+ * {@link ConsoleArgument}.
82
+ *
83
+ * @return true iff one of this argument's flags matches the first string in
84
+ * the given list, or this argument has no explicit flags.
83
85
*/
84
- protected boolean isAlias (final LinkedList <String > args ) {
85
- return aliasFlags .isEmpty () || aliasFlags .contains (args .getFirst ());
86
+ protected boolean isFlag (final LinkedList <String > args ) {
87
+ return flags .isEmpty () || flags .contains (args .getFirst ());
86
88
}
87
89
}
0 commit comments