Java Integer Create toInt(String pString)

Here you can find the source of toInt(String pString)

Description

to Int

License

Open Source License

Declaration

public static final Integer toInt(String pString) 

Method Source Code

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

public class Main {
    public static final Integer INTEGER_MAX_VALUE = new Integer(
            Integer.MAX_VALUE);

    public static final Integer toInt(String pString) {
        if (isNull(pString)) {
            return null;
        }/* w w  w  . jav  a  2  s . c  om*/
        if (pString.equals("unbounded")) {
            return INTEGER_MAX_VALUE;
        }
        return Integer.valueOf(pString);
    }

    public static boolean isNull(Object pStringOrObject) {
        if (pStringOrObject == null || pStringOrObject.equals("")) {
            return true;
        }
        return false;
    }
}

Related

  1. toInt(String intValue, int defaultValue)
  2. toInt(String number)
  3. toInt(String numStr, int defaultValue)
  4. toInt(String param)
  5. toInt(String param)
  6. toInt(String s)
  7. toInt(String s)
  8. toInt(String s)
  9. toInt(String s, int defaultInt)