private static int toMagnitude(String durationSpec) {
        try {
            return Integer.parseInt(durationSpec.substring(0, durationSpec.length() - 1));
        }
        catch (NumberFormatException e) {
            throw new IllegalArgumentException("Must be an integer followed by 'm', 'h' or 'd'");
        }
    }
Returns a string consisting of a number followed by "m", "h" or "d" to a duration given in that unit,
or zero duration if null or blank.
config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java