Parse a string representation of an Integer value.

@param value string representation
@return Integer value
189884
public static Integer parseInteger(String value) throws ParseException
   {
      Integer result = null;

      if (value.length() > 0 && value.indexOf(' ') == -1)
      {
         if (value.indexOf('.') == -1)
         {
            result = Integer.valueOf(value);
         }
         else
         {
            Number n = DatatypeConverter.parseDouble(value);
            result = Integer.valueOf(n.intValue());
         }
      }

      return result;
   }
282723
def _ConvertInteger(value):
  
  if isinstance(value, float) and not value.is_integer():
    raise ParseError('Couldn\'t parse integer: {0}.'.format(value))

  if isinstance(value, six.text_type) and value.find(' ') != -1:
    raise ParseError('Couldn\'t parse integer: "{0}".'.format(value))

  return int(value)
666473
public static boolean isRange(String value) {
        if (value == null) {
            return false;
        }
        try {
            Set<Integer> values = parseRange(value);
            return values.size() > 0;
        } catch (Exception e) {
            return false;
        }
    }
260065
private int idToInt(String value) {
    try {
      return Integer.valueOf(value);
    } catch (NumberFormatException e) {
      throw new ConfigurationException("invalid type ID: " + value);
    }
  }
1129807
private double parseIntoDouble(String value) {
        double returnVal = 0.0;
        if (value.charAt(0) == '.') value = "0" + value;
        int bracketIndex = value.indexOf('(');
        if (bracketIndex != -1) {
            value = value.substring(0, bracketIndex);
        }
        try {
            returnVal = Double.parseDouble(value);
        } catch (Exception exception) {
            logger.error("Could not parse double string: ", value);
        }
        return returnVal;
    }
1240870
public static boolean isInteger (String value)
    {
        try {
            Integer.parseInt(value);
            return true;
        } catch (NumberFormatException nfe) {
            // fall through
        }
        return false;
    }
170407
public static Integer readInteger(String value, Integer defaultValue) {
		if (!StringUtils.hasText(value)) return defaultValue;
		
		return Integer.valueOf(value);
	}
1313760
public static function parseString($value) {
        if (null === $value) {
            return null;
        }
        if (0 === preg_match("/^[0-9]{1,}$/", $value)) {
            throw new IntegerArgumentException($value);
        }
        return intval($value);
    }
842974
public static int parseInt(final String value) {
        if (value != null && value.charAt(0) == '+') {
            return Integer.parseInt(value.substring(1));
        }
        return Integer.parseInt(value);
    }
283367
private Object convertStringToNearestObjectType(String value) {
    switch (value) {
      case "true":
        return true;
      case "false":
        return false;
      default: {
        if (NumberUtils.isParsable(value)) {
          return Integer.parseInt(value);
        }
        return value;
      }
    }
  }
1060922
private static Object toNumber( String value)
    {
    Object number;

    try
      {
      number = toExternalNumber( new BigDecimal( value));
      }
    catch( Exception e)
      {
      number = null;
      }

    return number;
    }
1180581
@Override
    public Object convert(String value) {
        if (value == null || value.isEmpty()) {
            return value;
        }

        Object result = Ints.tryParse(value);

        if (result != null) {
            return result;
        }

        result = Longs.tryParse(value);

        if (result != null) {
            return result;
        }

        result = Doubles.tryParse(value);

        if (result != null) {
            return result;
        }

        return value;
    }
186314
private static Number getNumberValue(String value, String numFmtString) {
		if(StrUtil.isBlank(value)) {
			return null;
		}
		double numValue = Double.parseDouble(value);
		// 普通数字
		if (null != numFmtString && numFmtString.indexOf(StrUtil.C_DOT) < 0) {
			final long longPart = (long) numValue;
			if (longPart == numValue) {
				// 对于无小数部分的数字类型，转为Long
				return longPart;
			}
		}
		return numValue;
	}
235416
public static final Integer parseMinutesFromHours(String value)
   {
      Integer result = null;
      if (value != null)
      {
         result = Integer.valueOf(Integer.parseInt(value) * 60);
      }
      return result;
   }
1329583
private static List<Integer> parseArray(String value, ValueParser parser){
		final List<Integer> values = new ArrayList<>();
	
		final List<String> parts = StrUtil.split(value, StrUtil.C_COMMA);
		for (String part : parts) {
			CollectionUtil.addAllIfNotContains(values, parseStep(part, parser));
		}
		return values;
	}
690997
public static int getInteger(
    Object  value)
  {
    if (value == null)
    {
        return 0;
    }

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

    return Integer.valueOf(value.toString()).intValue();

  }
1159267
function parseInteger (value) {
  if (/^[-+]?[0-9]+$/.test(value)) {
    return parseInt(value, 10)
  }

  // "yes" and "no" are not integers but are supported by browsers.
  if (/^yes$/i.test(value)) {
    return 1
  }
  if (/^no$/i.test(value)) {
    return 0
  }

  return null
}