< prev index next >

src/jdk.jpackage/share/classes/jdk/jpackage/internal/EnumeratedBundlerParam.java

Print this page

        

*** 57,73 **** // perspective the string to display to the user is the key and then the // value is some type of object (although probably a String in most cases) private final Map<String, T> elements; private final boolean strict; ! EnumeratedBundlerParam(String name, String description, ! String id, Class<T> valueType, Function<Map<String, ? super Object>, T> defaultValueFunction, BiFunction<String, Map<String, ? super Object>, T> stringConverter, Map<String, T> elements, boolean strict) { - this.name = name; - this.description = description; this.id = id; this.valueType = valueType; this.defaultValueFunction = defaultValueFunction; this.stringConverter = stringConverter; this.elements = elements; --- 57,70 ---- // perspective the string to display to the user is the key and then the // value is some type of object (although probably a String in most cases) private final Map<String, T> elements; private final boolean strict; ! EnumeratedBundlerParam(String id, Class<T> valueType, Function<Map<String, ? super Object>, T> defaultValueFunction, BiFunction<String, Map<String, ? super Object>, T> stringConverter, Map<String, T> elements, boolean strict) { this.id = id; this.valueType = valueType; this.defaultValueFunction = defaultValueFunction; this.stringConverter = stringConverter; this.elements = elements;
*** 94,114 **** boolean isLoose() { return !isStrict(); } - T validatedFetchFrom(Map<String, ? super Object> params) - throws InvalidBundlerParamException { - if (isStrict()) { - T value = fetchFrom(params); - if (!isInPossibleValues(value)) { - throw new InvalidBundlerParamException("Parameter " - + value.toString() - + " not in valid set of values for BundlerParam " - + name); - } - return value; - } - return fetchFrom(params); - } - } --- 91,96 ----
< prev index next >