Java Integer Create toInt(Object value)

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

Description

to Int

License

Open Source License

Declaration

public static int toInt(Object value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int toInt(Object value) {
        return (value == null || "null".equals(value.toString())) ? 0 : Integer.parseInt(value.toString().trim());
    }/*from  w w w  . j ava 2s  .  c o m*/

    public static String toString(Object value) {
        return value == null || "null".equals(value.toString()) ? "" : value.toString();
    }
}

Related

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