List of utility methods to do Integer Create
int | toInt(String str) to Int if (str != null && !str.equals("")) { int value1; try { value1 = Integer.parseInt(str); } catch (Exception var3) { var3.printStackTrace(); value1 = 0; return value1; } else { return 0; |
int | toInt(String str, int defaultValue) Convert the string to int. int value = defaultValue; if (str == null || str.length() <= 0) { return value; try { value = Integer.parseInt(str); } catch (NumberFormatException e) { value = defaultValue; ... |
int | toInt(String str, int defaultValue) Convert a If the string is NumberUtils.toInt(null, 1) = 1 NumberUtils.toInt("", 1) = 1 NumberUtils.toInt("1", 0) = 1 if (str == null) { return defaultValue; try { return Integer.parseInt(str); } catch (NumberFormatException nfe) { return defaultValue; |
int | toInt(String str, int defValue) to Int try { return Integer.parseInt(str); } catch (Exception e) { return defValue; |
int | toInt(String str, int val) to Int return str != null ? Integer.parseInt(str) : val; |
int | toInt(String string) to Int assert string.length() == 4; int integer = 0; for (int i = 0; i < string.length(); i++) { byte tmp = decodeHexChar(string.charAt(i)); integer <<= 4; integer |= tmp; return integer; ... |
int | ToInt(String string) To Int try { return Integer.parseInt(string); } catch (NumberFormatException e) { return -1; |
int | toInt(String string) to Int if (string.length() != 4) throw new IllegalArgumentException( "length must be 4, got \"" + string + "\", length=" + string.length()); byte[] bytes = string.getBytes(); return ((bytes[0] & 0xFF) << 24) | ((bytes[1] & 0xFF) << 16) | ((bytes[2] & 0xFF) << 8) | (bytes[3] & 0xFF); |
int | toInt(String string) Convert String to an integer. int val = 0; boolean started = false; boolean minus = false; for (int i = 0; i < string.length(); i++) { char b = string.charAt(i); if (b <= ' ') { if (started) break; ... |
int | toInt(String string) string2Int String str = trim(string); if ("".equals(str)) str = "0"; return Integer.parseInt(str); |