@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }
@Override public Object decode(Decoder dec, Number s) { double dd = s.doubleValue(); if (type == double.class || type == Double.class) return s.doubleValue(); if ((type == int.class || type == Integer.class) && within(dd, Integer.MIN_VALUE, Integer.MAX_VALUE)) return s.intValue(); if ((type == long.class || type == Long.class) && within(dd, Long.MIN_VALUE, Long.MAX_VALUE)) return s.longValue(); if ((type == byte.class || type == Byte.class) && within(dd, Byte.MIN_VALUE, Byte.MAX_VALUE)) return s.byteValue(); if ((type == short.class || type == Short.class) && within(dd, Short.MIN_VALUE, Short.MAX_VALUE)) return s.shortValue(); if (type == float.class || type == Float.class) return s.floatValue(); if (type == BigDecimal.class) return BigDecimal.valueOf(dd); if (type == BigInteger.class) return BigInteger.valueOf(s.longValue()); throw new IllegalArgumentException("Unknown number format: " + type); }