code: public static MetricValue fromNumberValue(Number number) {
          if (number == null) {
              return EMPTY;
          } else if (number instanceof Float || number instanceof Double) {
              return fromDblValue(number.doubleValue());
          } else if (number instanceof Byte || number instanceof Short || number instanceof Integer || number instanceof Long) {
              return fromIntValue(number.longValue());
          } else {
              throw new IllegalArgumentException("Unrecognized number type: " + number.getClass());
          }
      }
docs: Construct a metric value from a Number implementation.
  @param number A floating point or integral type.
  @return a MetricValue holding the specified number.
  @throws IllegalArgumentException if the derived type of Number is not recognized.