@Override
  public BigInteger getBigIntegerValue() throws JsonParseException {
    Number number = getNumberValue();

    if (number instanceof BigInteger) {
      return (BigInteger) number;
    }

    if (number instanceof BigDecimal) {
      return ((BigDecimal) number).toBigInteger();
    }

    if (number instanceof Byte || number instanceof Integer || number instanceof Long || number instanceof Short) {
      return BigInteger.valueOf(number.longValue());
    } else if (number instanceof Double || number instanceof Float) {
      return BigDecimal.valueOf(number.doubleValue()).toBigInteger();
    }

    return new BigInteger(number.toString());
  }
Read (parse) current bson value and stored it in local {@link ParseContext} cache.
criteria/mongo/src/org/immutables/criteria/mongo/bson4jackson/BsonParser.java