Java Utililty Methods Integer Convert To

List of utility methods to do Integer Convert To

Description

The list of methods to do Integer Convert To are organized into topic(s).

Method

StringfromInteger(int value)
from Integer
return Integer.toString(value);
StringfromInteger(Integer value)
integerValue
String result = "0";
if (value != null)
    result = String.valueOf(value.intValue());
return result;
StringfromInteger(Integer value, String defaultValue)
from Integer
if (value != null) {
    return value.toString();
return defaultValue;
String[]fromIntegers(Integer[] values, String defaultValue)
from Integers
String[] result = new String[values == null ? 0 : values.length];
for (int i = 0; i < result.length; i++) {
    result[i] = fromInteger(values[i], defaultValue);
return result;
IntegerfromIntegerString(String integerString)
Deserializes an Integer from a given string.
if (integerString == null) {
    return null;
try {
    Integer i = new Integer(integerString);
    return i;
} catch (Exception e) {
return null;
StringfromInternalForm(String internalForm)
from Internal Form
return internalForm.replace('/', '.');
longfromIntLong(byte[] value)
from Int Long
return fromIntLong(value, 0);
String[]fromInts(int[] values)
from Ints
String[] result = new String[values == null ? 0 : values.length];
for (int i = 0; i < result.length; i++) {
    result[i] = fromInt(values[i]);
return result;
IntegerfromIntString(Object obj)
Parses the specified string as an Integer instance.
String intString = (obj == null) ? null : obj.toString();
if (intString == null || intString.trim().isEmpty()) {
    return ZERO_INT;
try {
    return Integer.parseInt(intString);
} catch (Exception e) {
    return 0;
...
byte[]fromIntWithPrefix(byte prefix, int v)
from Int With Prefix
return new byte[] { prefix, (byte) ((v >> 24) & 0xff), (byte) ((v >> 16) & 0xff), (byte) ((v >> 8) & 0xff),
        (byte) ((v >> 0) & 0xff), };