Java Integer Create toIntPlusOneString(Object object)

Here you can find the source of toIntPlusOneString(Object object)

Description

to Int Plus One String

License

Open Source License

Declaration

public static String toIntPlusOneString(Object object) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String toIntPlusOneString(Object object) {
        if (object == null) {
            return null;
        } else {//  ww  w.  j a  v  a2 s. c  om
            return toIntString(toInt(object) + 1);
        }
    }

    public static String toIntString(Object object) {
        if (object == null) {
            return null;
        } else if (object instanceof Number) {
            return String.valueOf(((Number) object).intValue());
        } else {
            return object.toString();
        }
    }

    public static int toInt(Object object) {
        if (object == null) {
            return -1;
        } else if (object instanceof Number) {
            return ((Number) object).intValue();
        } else {
            return Integer.parseInt(object.toString());
        }
    }
}

Related

  1. toIntHeader(String value)
  2. toIntLE(byte[] value)
  3. toIntList(String valus)
  4. toIntMatrix(Number[][] matrix)
  5. toIntOrNull(String string)
  6. toIntRound(double[] a)
  7. toInts(byte[] bytes)
  8. toInts(byte[] readBuffer, int o, int l)
  9. toInts(byte[] src, int srcOffset, int[] dst, int dstOffset, int length)