Merge "Bug 2347: DOMConcurrentDataCommitCoordinator uses wrong phase name"
[controller.git] / third-party / openflowj / src / main / java / org / openflow / example / cli / Option.java
1 package org.openflow.example.cli;
2
3 public class Option {
4     String shortOpt;
5     String longOpt;
6     Object defaultVal;
7     String val; // current value of this option, string form
8     boolean specified; // was this option found in the cmdline?
9     String comment;
10
11     /**
12      * Option information storrage
13      * 
14      * @param shortOpt
15      *            Short name for the option, e.g., "-p"
16      * @param longOpt
17      *            Long name for option, e.g., "--port"
18      * @param defaultVal
19      *            default value: "6633" or null if no default value
20      * @param comment
21      *            String to print to explain this option, e.g., a help message
22      */
23     public Option(String shortOpt, String longOpt, Object defaultVal,
24             String comment) {
25         super();
26         this.shortOpt = shortOpt;
27         this.longOpt = longOpt;
28         this.defaultVal = defaultVal;
29         this.comment = comment;
30         this.specified = false;
31     }
32
33     public Option(String shortOpt, String longOpt, String comment) {
34         this(shortOpt, longOpt, null, comment);
35     }
36
37     public boolean needsArg() {
38         return this.defaultVal != null;
39     }
40 }