Welcome to the Ranch
What is
req? What is the return type of
getValues()? Does it return a Map with a different generic type, or even a raw type?
It would appear you are getting a String-Long pairing. The valueOf method takes
int or
String parameters; if you pass an
Integer, that would be unboxed to
int, but you can’t unbox a Long to an
int. So the JVM tries to cast the result to a String, and that doesn’t work.
I think the problem is filling the Map inappropriately from a (??) database request. Did you get any compiler warnings for that code? If you do,
you should heed them. If there are any warnings, then type‑safety cannot be guaranteed, as you see here.
By the way: house numbers are not integers. They are not numbers of any sort. I have had friends living at no 11a, at no 32a, at no 2½, etc. House numbers are Strings.