Java Integer Create toInteger(String string, Integer deff)

Here you can find the source of toInteger(String string, Integer deff)

Description

to Integer

License

Mozilla Public License

Declaration

public static Integer toInteger(String string, Integer deff) 

Method Source Code

//package com.java2s;
//License from project: Mozilla Public License 

public class Main {
    public static Integer toInteger(String string, Integer deff) {
        Integer value = deff;//from   ww w  .  j a va 2s.  c  om
        try {

            if (string != null) {
                value = Integer.valueOf(string.toString());
            }

        } catch (NullPointerException e) {
            e.printStackTrace();
        }
        return value;

    }
}

Related

  1. toInteger(String s, int defValue)
  2. toInteger(String str)
  3. toInteger(String str)
  4. toInteger(String str)
  5. toInteger(String string)
  6. toInteger(String val)
  7. toInteger(String value)
  8. toInteger(String value)
  9. toInteger(String value)