< prev index next >
test/testlibrary/jittester/src/jdk/test/lib/jittester/utils/OptionResolver.java
Print this page
*** 164,178 ****
throw new RuntimeException("Option is already registered for key " + option.shortName);
}
}
public abstract class Option<T> {
!
! Character shortName;
! String longName;
! protected T defaultValue;
! protected String description;
public Option(Character shortName, String longName, T defaultValue, String description) {
this.shortName = shortName;
this.longName = longName;
this.defaultValue = defaultValue;
--- 164,177 ----
throw new RuntimeException("Option is already registered for key " + option.shortName);
}
}
public abstract class Option<T> {
! protected final Character shortName;
! protected final String longName;
! protected final T defaultValue;
! protected final String description;
public Option(Character shortName, String longName, T defaultValue, String description) {
this.shortName = shortName;
this.longName = longName;
this.defaultValue = defaultValue;
*** 198,207 ****
--- 197,210 ----
@SuppressWarnings("unchecked")
public T value() {
return (T) values.getOrDefault(this, defaultValue);
}
+ public boolean isSet() {
+ return values.containsKey(this);
+ }
+
public boolean isFlag() {
return false;
}
public abstract T parseFromString(String arg);
< prev index next >