- java.lang.Object
-
- de.carne.util.cmdline.CmdLineAction
-
public abstract class CmdLineAction extends java.lang.ObjectThis class represents an action associated with a set of recognized command line args.An action can either be a switch (e.g.
--switch) or an option (e.g. {«code --option value}).
-
-
Constructor Summary
Constructors Constructor Description CmdLineAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmdLineActionarg(java.lang.String arg)Adds an argument string that should trigger this CmdLineAction instance.booleancontains(java.lang.String arg)Checks whether the submitted argument string is a trigger for this CmdLineAction instance.java.lang.StringtoString()
-
-
-
Method Detail
-
arg
public CmdLineAction arg(java.lang.String arg)
Adds an argument string that should trigger this CmdLineAction instance.- Parameters:
arg- the argument string to be associated with this CmdLineAction instance.- Returns:
- the updated CmdLineAction instance.
-
contains
public boolean contains(java.lang.String arg)
Checks whether the submitted argument string is a trigger for this CmdLineAction instance.- Parameters:
arg- the argument string to check.- Returns:
trueif the argument string is associated with this CmdLineAction instance.- See Also:
arg(String)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-