List of utility methods to do Integer Create
int | toInt(final String str, int defaultValue) Method to convert string to Integer when a default value is given if (str == null) { return defaultValue; try { return Integer.parseInt(str); } catch (final NumberFormatException exception) { return defaultValue; |
String | toInt(final String string) to Int if (string == null) { return "-1"; return String.valueOf(Integer.parseInt(string)); |
int | toInt(final String strPriority) to Int if (strPriority != null && strPriority.length() != 0) { try { return Integer.parseInt(strPriority); } catch (NumberFormatException e) { return 0; |
int | toInt(final String text, final int defaultValue) Re-conversion of the textual representation of an Integer . if (text != null) { try { return Integer.parseInt(text); } catch (final NumberFormatException nfe) { return defaultValue; |
int | toInt(final String value) To int. return (int) toLong(value); |
int | toInt(float value) to Int return (new Float(truncate(value, 0))).intValue(); |
int | toInt(int byteSignificance, byte b) to Int return ((b & 0xFF) << (8 * byteSignificance));
|
int | toInt(int[] rgb) to Int return toInt(rgb[0], rgb[1], rgb[2]);
|
int | toInt(Integer i) Transform an Integer to an int ( null will be transformed to 0 ).
int returnValue = 0; if (i != null) { returnValue = i; return returnValue; |
int | toInt(Integer n) Returns either an n converted to int, or 0 if n equals null return n != null ? n : 0;
|