Java how to infer type from data coming from multiple sources
问题 I'm developing a java server that collects data from multiple sensors. These sensors usually return the queried values as string values. In the header it's indicated the data type that the server has to use to cast the received value. These value can be integer, boolean, double, float, and long. It might happen that the sensors don't provide the "data type description" of the values so: I want to find a way to understand the data type it analyzing the received string. I was thinking about