src/share/classes/com/sun/tools/javac/util/Options.java

changeset 923
6970d9fb8e02
parent 798
4868a36f6fd8
child 962
0ff2bbd38f10
equal deleted inserted replaced
916:cb9493a80341 923:6970d9fb8e02
71 /** 71 /**
72 * Get the value for an option. 72 * Get the value for an option.
73 */ 73 */
74 public String get(OptionName name) { 74 public String get(OptionName name) {
75 return values.get(name.optionName); 75 return values.get(name.optionName);
76 }
77
78 /**
79 * Get the boolean value for an option, patterned after Boolean.getBoolean,
80 * essentially will return true, iff the value exists and is set to "true".
81 */
82 public boolean getBoolean(String name) {
83 return getBoolean(name, false);
84 }
85
86 /**
87 * Get the boolean with a default value if the option is not set.
88 */
89 public boolean getBoolean(String name, boolean defaultValue) {
90 String value = get(name);
91 return (value == null) ? defaultValue : Boolean.parseBoolean(value);
76 } 92 }
77 93
78 /** 94 /**
79 * Check if the value for an undocumented option has been set. 95 * Check if the value for an undocumented option has been set.
80 */ 96 */

mercurial