Java Integer Create toInteger(Object value)

Here you can find the source of toInteger(Object value)

Description

to Integer

License

Apache License

Declaration

public static Integer toInteger(Object value) 

Method Source Code

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

public class Main {
    /** EMPTY [String] */
    public static final String EMPTY = "";

    public static Integer toInteger(Object value) {

        try {//from w  ww. j a va2  s.  c om
            if (value == null || EMPTY.equals(value)) {
                return null;
            }
            return Integer.valueOf(value.toString());
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }

    }
}

Related

  1. toInteger(Object val)
  2. toInteger(Object val)
  3. toInteger(Object value)
  4. toInteger(Object value)
  5. toInteger(Object value)
  6. toInteger(Object value)
  7. toInteger(Object value)
  8. toInteger(Object value)
  9. toInteger(Object value, int defaultValue)