static private int findPort(String varName, int defaultPort) {
        Optional<String> port = Optional.ofNullable(System.getenv(varName));
        if ( ! port.isPresent() || port.get().trim().isEmpty()) {
            log.fine("" + varName + " not set, using " + defaultPort);
            return defaultPort;
        }
        try {
            return Integer.parseInt(port.get());
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("must be an integer, was '" + port.get() + "'");
        }
    }
The defaults of basic Vespa configuration variables.
Use Defaults.getDefaults() to access the defaults of this runtime environment.

@author arnej27959
@author bratseth
defaults/src/main/java/com/yahoo/vespa/defaults/Defaults.java