List of utility methods to do Integer Create
int | toInt(Object object, int defaultValue) to Int if (object == null) { return defaultValue; } else if (object instanceof Number) { return ((Number) object).intValue(); } else if (object instanceof String) { try { return Integer.parseInt((String) object); } catch (NumberFormatException ex) { ... |
int | toInt(Object objValue) to Int if (objValue != null) { if (objValue instanceof Number) { return ((Number) objValue).intValue(); } else { return Integer.parseInt(objValue.toString()); } else return 0; ... |
int | toInt(Object property, int defaultValue) to Int if (property == null) { return defaultValue; return Integer.parseInt(String.valueOf(property)); |
int | toInt(Object val) to Int if (val instanceof Integer) { return ((Integer) val).intValue(); } else { return (int) Math.round(toDouble(val)); |
Integer | toInt(Object val) to Int if (val == null) { return "null".hashCode(); } else if (val instanceof Integer) { return (Integer) val; } else if (val instanceof String) { try { val = ((String) val).trim(); int v = Integer.parseInt((String) val); ... |
Integer | toInt(Object value) To int. return Integer.parseInt(value.toString());
|
int | toInt(Object value) Converts the specified object into an integer. if (value instanceof Number) { return ((Number) value).intValue(); } else { return Integer.parseInt(String.valueOf(value)); |
int | toInt(Object value) to Int return (value == null || "null".equals(value.toString())) ? 0 : Integer.parseInt(value.toString().trim()); |
int | toInt(Object value, int defaultValue) to Int try { return toInt(value); } catch (Exception e) { return defaultValue; |
int | toInt(Object value, int nullValue) to Int if (value == null) return nullValue; if (value instanceof Number) return ((Number) value).intValue(); else return Integer.parseInt(value.toString()); |