Estava usando esse método para converter meu Object em Integer mas deu erro de formato.
public static Integer validarRetornoInteger(Object object) {
if (object != null) {
return (Integer) object;
}
return null;
}
A solução por enquanto foi iniciar um novo Integer com a String do Object.
public static Integer validarRetornoInteger(Object object) {
if (object != null && object.hashCode() != 0) {
Integer objectInteger = new Integer(object.toString());
return objectInteger;
}
return null;
}
Alguém sabe como posso fazer cast nesse caso?