@Test(expected = ConversionException.class) public void nan() { BigIntegerConverter converter = new BigIntegerConverter(); converter.convertToObject("a12345a", Locale.GERMAN); }
@Override public BigInteger convertToObject(final String value, final Locale locale) { if (Strings.isEmpty(value)) { return null; } final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); if (number instanceof BigInteger) { return (BigInteger) number; } else if (number instanceof Long) { return BigInteger.valueOf(number.longValue()); } else if (number instanceof Integer) { return BigInteger.valueOf(number.intValue()); } else { return new BigInteger(value); } }
BigIntegerConverter extends AbstractIntegerConverter<BigInteger> { @Override public BigInteger convertToObject(final String value, final Locale locale) { if (Strings.isEmpty(value)) { return null; } final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); if (number instanceof BigInteger) { return (BigInteger) number; } else if (number instanceof Long) { return BigInteger.valueOf(number.longValue()); } else if (number instanceof Integer) { return BigInteger.valueOf(number.intValue()); } else { return new BigInteger(value); } } }
BigIntegerConverter extends AbstractIntegerConverter<BigInteger> { @Override public BigInteger convertToObject(final String value, final Locale locale) { if (Strings.isEmpty(value)) { return null; } final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); if (number instanceof BigInteger) { return (BigInteger) number; } else if (number instanceof Long) { return BigInteger.valueOf(number.longValue()); } else if (number instanceof Integer) { return BigInteger.valueOf(number.intValue()); } else { return new BigInteger(value); } }  }
BigIntegerConverter extends AbstractIntegerConverter<BigInteger> { @Override public BigInteger convertToObject(final String value, final Locale locale) { if (Strings.isEmpty(value)) { return null; } final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); if (number instanceof BigInteger) { return (BigInteger) number; } else if (number instanceof Long) { return BigInteger.valueOf(number.longValue()); } else if (number instanceof Integer) { return BigInteger.valueOf(number.intValue()); } else { return new BigInteger(value); } }  @Override BigInteger convertToObject(final String value, final Locale locale); }
BigIntegerConverter extends AbstractIntegerConverter<BigInteger> { @Override public BigInteger convertToObject(final String value, final Locale locale) { if (Strings.isEmpty(value)) { return null; } final Number number = parse(value, -Double.MAX_VALUE, Double.MAX_VALUE, locale); if (number instanceof BigInteger) { return (BigInteger) number; } else if (number instanceof Long) { return BigInteger.valueOf(number.longValue()); } else if (number instanceof Integer) { return BigInteger.valueOf(number.intValue()); } else { return new BigInteger(value); } }  @Override BigInteger convertToObject(final String value, final Locale locale);  }