Java Utililty Methods Integer Create

List of utility methods to do Integer Create

Description

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

Method

IntegertoInteger(final Object value)
To integer.
return (int) toDouble(value);
inttoInteger(final String bitString)
Convert a bit string into an integer value.
assert (bitString.length() <= Integer.SIZE);
return (int) toLong(bitString);
inttoInteger(final String integerAsString)
to Integer
return Integer.parseInt(integerAsString);
IntegertoInteger(final String value)
Converts a String to an integer plus if the String is NULL, the returned value will be NULL.
if (value == null) {
    return null;
return Integer.valueOf(value);
IntegertoInteger(final String value)
create Intger from str.
return Integer.parseInt(value);
IntegertoInteger(int value)
to Integer
return new Integer(value);
IntegertoInteger(int value)
Integer is not a JsType and can't be shared across scripts.
return (value != -1) ? value : null;
Integer[]toInteger(int[] arr)
to Integer
Integer[] ret = new Integer[arr.length];
for (int i = 0; i < arr.length; i++) {
    ret[i] = arr[i];
return ret;
inttoInteger(int[] bytes)
to Integer
if (bytes.length > 4 || bytes == null)
    return 0;
return (bytes[3]) | (bytes[2] << 8) | (bytes[1] << 16) | (bytes[0] << 24);
IntegertoInteger(Long l)
to Integer
if (l == null) {
    return null;
if (l > Integer.MAX_VALUE || l < Integer.MIN_VALUE) {
    throw new IllegalArgumentException("Couldn't cast value to Integer " + l);
return l.intValue();