private static OptionalInt parseOptionalInt(String s) {
        try {
            s = s.trim();
            if (s.isEmpty()) return OptionalInt.empty();
            return OptionalInt.of(Integer.parseInt(s));
        }
        catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("'" + s + "' is not an integer");
        }
    }
Parses a value ("value"), value range ("[min-value?, max-value?]"), or empty.
config-provisioning/src/main/java/com/yahoo/config/provision/IntRange.java