Cannot convert A857 of type class java.lang.String to class java.lang.Integer解决思

Cannot convert A857 of type class java.lang.String to class java.lang.Integer定制的标签,参数类型为I

Cannot convert A857 of type class java.lang.String to class java.lang.Integer
定制的标签,参数类型为Integer ,如果传入A848这样的参数就会报错,
请问如何处理,

public static Resources getObject(Integer id) {
return resourcesService.getVirusResource(id);
}

[解决办法]
在调用这个方法之前判断传入的是不是整数,比如用正则验证等。