@Test(groups = "fast") public void parseBigNumber() throws Exception { String number = String.valueOf(Long.MAX_VALUE) + "8729839871981298798234"; TypeConverter<BigInteger> converter = new BigIntegerTypeConverter(); converter.setLocale(Locale.US); BigInteger result = converter.convert(number, BigInteger.class, errors()); Assert.assertEquals(result, new BigInteger(number)); Assert.assertEquals(result.toString(), number); }
public BigInteger convert(String input, Class<? extends BigInteger> targetType, Collection<ValidationError> errors) { BigDecimal decimal = (BigDecimal) parse(input, errors); if (errors.size() == 0) { return decimal.toBigInteger(); } else { return null; } }
BigIntegerTypeConverter extends NumberTypeConverterSupport implements TypeConverter<BigInteger> { public BigInteger convert(String input, Class<? extends BigInteger> targetType, Collection<ValidationError> errors) { BigDecimal decimal = (BigDecimal) parse(input, errors); if (errors.size() == 0) { return decimal.toBigInteger(); } else { return null; } } }
BigIntegerTypeConverter extends NumberTypeConverterSupport implements TypeConverter<BigInteger> { public BigInteger convert(String input, Class<? extends BigInteger> targetType, Collection<ValidationError> errors) { BigDecimal decimal = (BigDecimal) parse(input, errors); if (errors.size() == 0) { return decimal.toBigInteger(); } else { return null; } }  }
BigIntegerTypeConverter extends NumberTypeConverterSupport implements TypeConverter<BigInteger> { public BigInteger convert(String input, Class<? extends BigInteger> targetType, Collection<ValidationError> errors) { BigDecimal decimal = (BigDecimal) parse(input, errors); if (errors.size() == 0) { return decimal.toBigInteger(); } else { return null; } }  BigInteger convert(String input,
            Class<? extends BigInteger> targetType,
            Collection<ValidationError> errors); }
BigIntegerTypeConverter extends NumberTypeConverterSupport implements TypeConverter<BigInteger> { public BigInteger convert(String input, Class<? extends BigInteger> targetType, Collection<ValidationError> errors) { BigDecimal decimal = (BigDecimal) parse(input, errors); if (errors.size() == 0) { return decimal.toBigInteger(); } else { return null; } }  BigInteger convert(String input,
            Class<? extends BigInteger> targetType,
            Collection<ValidationError> errors);  }