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 {
    public static Integer toInteger(Object value) {
        if (value == null) {
            return 0;
        }/*ww  w  . j  a  v a 2  s  .c  o  m*/
        return Integer.parseInt(value.toString());
    }

    public static String toString(Object value) {
        if (value == null) {
            return "";
        }
        return value.toString().trim();
    }
}

Related

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