I want to check if a string is an int, long, float, double or boolean.

For example, "1" should be int, "1.22" should be float and "1.5555555" should be double.

This is the best I've managed:

```
case item: String =>

        if (item.toInt.toString.equals(item)) {
          arrayType = Int.getClass
          ByteBuffer.allocate(4 * array.length)
        }
        else if (item.toLong.toString.equals(item)) {
          arrayType = Long.getClass
          ByteBuffer.allocate(8 * array.length)
        }
        else if (item.toFloat.toString.equals(item)) {
          arrayType = Float.getClass
          ByteBuffer.allocate(4 * array.length)
        }
        else if (item.toDouble.toString.equals(item)) {
          arrayType = Double.getClass
          ByteBuffer.allocate(8 * array.length)
        }
        else if (item.toBoolean.toString.equals(item)) {
          arrayType = Boolean.getClass
          ByteBuffer.allocate(array.length)
        }

        else throw new UnsupportedOperationException("Type not supported: " + item.getClass)

```