public static String changeToString(Object o){
if (o instanceof Integer) {
Integer str = (Integer) o;
return str.toString();
}else if (o instanceof BigInteger) {
BigInteger str = (BigInteger) o;
return str.toString();
}else if (o instanceof Long) {
Long str = (Long) o;
return str.toString();
}else if (o instanceof BigDecimal) {
BigDecimal str = (BigDecimal) o;
return str.toString();
}else if (o instanceof Double) {
Double str = (Double) o;
return str.toString();
}else if (o == null) {
return null;
}
return o.toString();
}
public static int changeToInt(Object o) {
if (o instanceof BigInteger) {
BigInteger bigInteger = (BigInteger) o;
return bigInteger.intValue();
}else if (o instanceof Long) {
Long l = (Long) o;
return l.intValue();
}else if (o instanceof BigDecimal) {
BigDecimal bigDecimal = (BigDecimal) o;
return bigDecimal.intValue();
}else if (o instanceof String) {
String str = (String) o;
return Integer.parseInt(str);
}else if (o instanceof Character) {
String str = o.toString();
return Integer.parseInt(str);
}else if (o == null) {
return 0;
}
return (Integer) o;
}
if (o instanceof Integer) {
Integer str = (Integer) o;
return str.toString();
}else if (o instanceof BigInteger) {
BigInteger str = (BigInteger) o;
return str.toString();
}else if (o instanceof Long) {
Long str = (Long) o;
return str.toString();
}else if (o instanceof BigDecimal) {
BigDecimal str = (BigDecimal) o;
return str.toString();
}else if (o instanceof Double) {
Double str = (Double) o;
return str.toString();
}else if (o == null) {
return null;
}
return o.toString();
}
public static int changeToInt(Object o) {
if (o instanceof BigInteger) {
BigInteger bigInteger = (BigInteger) o;
return bigInteger.intValue();
}else if (o instanceof Long) {
Long l = (Long) o;
return l.intValue();
}else if (o instanceof BigDecimal) {
BigDecimal bigDecimal = (BigDecimal) o;
return bigDecimal.intValue();
}else if (o instanceof String) {
String str = (String) o;
return Integer.parseInt(str);
}else if (o instanceof Character) {
String str = o.toString();
return Integer.parseInt(str);
}else if (o == null) {
return 0;
}
return (Integer) o;
}