Java Integer Create toInteger(Object obj)

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

Description

to Integer

License

Open Source License

Declaration

static Integer toInteger(Object obj) 

Method Source Code

//package com.java2s;

public class Main {
    static Integer toInteger(Object obj) {
        if (obj instanceof String)
            return Integer.parseInt((String) obj);
        if (obj instanceof Byte) {
            Byte b = (Byte) obj;
            return b.intValue();
        }/* w  w  w.j av a 2 s  .  c om*/
        if (obj instanceof Short) {
            Short s = (Short) obj;
            return s.intValue();
        }
        return (Integer) obj;
    }
}

Related

  1. toInteger(Object o)
  2. toInteger(Object o)
  3. toInteger(Object ob, Integer defaultInteger)
  4. toInteger(Object obj)
  5. toInteger(Object obj)
  6. toInteger(Object object)
  7. toInteger(Object object)
  8. toInteger(Object object, int defaultValue)
  9. toInteger(Object object, Integer defaultValue)