Java Integer Create toInt(Object object)

Here you can find the source of toInt(Object object)

Description

to Int

License

Apache License

Declaration

public static int toInt(Object object) 

Method Source Code

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

public class Main {
    public static int toInt(Object object) {
        return object instanceof Number ? ((Number) object).intValue() : Integer.parseInt(object.toString());
    }//from   w w  w  . j av a  2 s. c o  m

    public static String toString(Object object) {
        return object == null ? null : object.toString();
    }
}

Related

  1. toInt(Object obj)
  2. toInt(Object obj)
  3. toInt(Object obj)
  4. toInt(Object obj)
  5. toInt(Object obj)
  6. toInt(Object object, int defaultValue)
  7. toInt(Object objValue)
  8. toInt(Object property, int defaultValue)
  9. toInt(Object val)