Java Integer Create toInteger(Object o)

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

Description

to Integer

License

Open Source License

Declaration

public static Integer toInteger(Object o) 

Method Source Code

//package com.java2s;

public class Main {
    public static Integer toInteger(Object o) {
        Integer i;/*from   w  w  w .  ja  v a 2 s  .c om*/
        if (o instanceof Integer) {
            i = (Integer) o;
        } else {
            try {
                i = Integer.valueOf(o.toString());
            } catch (Exception e) {
                i = null;
            }
        }
        return i;
    }
}

Related

  1. toInteger(Number number)
  2. toInteger(Object _inStrObj)
  3. toInteger(Object _value, int _default)
  4. toInteger(Object anObj)
  5. toInteger(Object cell)
  6. toInteger(Object o)
  7. toInteger(Object ob, Integer defaultInteger)
  8. toInteger(Object obj)
  9. toInteger(Object obj)