protected static Long asLong(Object value, Long defaultValue) {
        try {
            if (value == null)
                return defaultValue;

            if (value instanceof Long)
                return (Long) value;

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

            return Long.valueOf(value.toString());
        } catch (IllegalArgumentException e) {
            throw new NumberFormatException("Not a valid long");
        }
    }
Returns a property as a Long.

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