title: Java how to infer type from data coming from multiple sources
body: <p>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.</p>
  
  <p>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. </p>
  
  <p>I was thinking about using REGEX but maybe there are some other ways to do it better. Any suggestion?</p>