class 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);
        }
    }

}