Fetches the supplied parameter from the request and converts it to an integer. If the
parameter does not exist or is not a well-formed integer, a data validation exception is
thrown with the supplied message.
323712
public static int requireIntParameter (HttpServletRequest req, String name,
                                           String invalidDataMessage, ParameterValidator validator)
        throws DataValidationException
    {
        String value = getParameter(req, name, false);
        validator.validateParameter(name, value);
        return parseIntParameter(value, invalidDataMessage);
    }
989811
public Integer getParaToInt(String name, Integer defaultValue) {
		return toInt(request.getParameter(name), defaultValue);
	}
750116
public int getInt(String key, int defaultValue) {
    	String value = get(key);
    	if(value == null) return defaultValue;
    	try {
    		return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(key + " parameter should be a number");
        }
    }
922534
public static int getInt(@NotNull ServletRequest request, @NotNull String param, int defaultValue) {
    String value = request.getParameter(param);
    return NumberUtils.toInt(value, defaultValue);
  }
103318
private Object processParam(TemplateParam<?, ?, ?> param, Map<String, Object> params, Template<?> template) {
		Object value = fetchParamValue(param, params, param.getFetcher());
		value = convertParamValue(value, param.getType(), param.getConverter());
		validateParamValue(value, param.getValidator());
		return value;
	}
233391
public Integer toInteger() {
		Integer value;
		value = Integer.valueOf(this.isNeg ? Integer.parseInt(this.param)*-1 : Integer.parseInt(this.param));
		return value;
	}
1183962
def __int(value):
    ''''''
    valid, _value = False, value
    try:
        _value = int(value)
        valid = True
    except ValueError:
        pass
    return (valid, _value, 'integer')
43450
def clean_int(x) -> int:
    
    try:
        return int(x)
    except ValueError:
        raise forms.ValidationError(
            "Cannot convert to integer: {}".format(repr(x)))
7064
protected void validateInteger(String field, String errorKey, String errorMessage) {
		validateIntegerValue(controller.getPara(field), errorKey, errorMessage);
	}
1289033
def is_valid_int_param(param):
    
    if param is None:
        return False
    try:
        param = int(param)
        if param < 0:
            return False
    except (TypeError, ValueError):
        return False
    return True
1143503
public static Integer parseInt(String param) {
		try {
			if (!StringUtils.isBlank(param)) {
				return Integer.valueOf(param);
			}
		} catch (Exception e) {
			throw new IllegalArgumentException("Parameter " + param + " is not a number.");
		}
		return null;
	}
609159
public static void notPositive(Integer value) {
		if(!validation) return;
		notNull(value);
		if(value > 0)
			throw new ParameterException(ErrorCode.POSITIVE);
	}
1014138
public int getInt(String key) {
    	String value = get(key);
    	Utils.require(value != null, key + " parameter is not set");
    	try {
    		return Integer.parseInt(value);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(key + " parameter should be a number");
        }
    }
886619
@VisibleForTesting
    protected int stringToInt(final String exp) {
        final Integer value = fieldConstraints.getStringMappingValue(exp);
        if (value != null) {
            return value;
        } else {
            try {
                return Integer.parseInt(exp);
            } catch (final NumberFormatException e) {
                final String invalidChars = new StringValidations(fieldConstraints).removeValidChars(exp);
                throw new IllegalArgumentException(String.format("Invalid chars in expression! Expression: %s Invalid chars: %s", exp, invalidChars));
            }
        }
    }
604369
private static Integer toInt(String str) {

        Integer num = null;
        try {
            num = Integer.parseInt(str);
        } catch (NumberFormatException ex) {
            log.severe(String.format("failed to convert str: %s to integer", str));
        }

        return num;
    }
1071078
public int getInteger() throws IOException {
        if (buffer.read() != DerValue.tag_Integer) {
            throw new IOException("DER input, Integer tag error");
        }
        return buffer.getInteger(getLength(buffer));
    }
743299
public static int getInt(@NotNull ServletRequest request, @NotNull String param) {
    return getInt(request, param, 0);
  }