protected static Integer asInteger(Object value, Integer defaultValue) {
        try {
            if (value == null)
                return defaultValue;

            if (value instanceof Number)
                return ((Number)value).intValue();

            String stringValue = value.toString();
            if (stringValue.isEmpty())
                return defaultValue;

            return Integer.valueOf(stringValue);
        } catch (IllegalArgumentException e) {
            throw new NumberFormatException("'" + value + "' is not a valid integer");
        }
    }
Returns a property as an Integer.

@param name         the property name
@param defaultValue the value to return if this property is null
@return the integer value for the name
@throws NumberFormatException if the given parameter does not exist
                              or does not have a toString parseable as a number
container-core/src/main/java/com/yahoo/processing/request/Properties.java