Java Integer Create ToInteger(String s)

Here you can find the source of ToInteger(String s)

Description

To Integer

License

Apache License

Declaration

public static final Integer ToInteger(String s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final Integer ToInteger(String s) {

        if (ToString(s).isEmpty()) {
            return null;
        }/*from   w w w.j a  va2 s.c o m*/

        return Integer.parseInt(ToString(s));
    }

    public static final Integer ToInteger(Object o) {
        return ToInteger(ToString(o));
    }

    public static final String ToString(Object o) {
        return o != null ? o.toString() : "";
    }

    public static final String ToString(String s) {
        return s != null ? s : "";
    }
}

Related

  1. toInteger(String ascii)
  2. toInteger(String integer)
  3. toInteger(String numeric)
  4. toInteger(String numericString)
  5. toInteger(String pString)
  6. toInteger(String s)
  7. toInteger(String s)
  8. toInteger(String s, int defValue)
  9. toInteger(String str)