@Override
  public NumberType getNumberType() throws IOException {
    final BsonType type = type();
    switch (type) {
      case DOUBLE:
        return NumberType.DOUBLE;
      case INT32:
        return NumberType.INT;
      case INT64:
        return NumberType.LONG;
      case DECIMAL128:
        return NumberType.BIG_DECIMAL;
      default:
        throw new IllegalStateException(String.format("Not a number type %s", type));
    }
  }
The ObjectCodec used to parse the Bson object(s)
mongo/src/org/immutables/mongo/bson4jackson/BsonParser.java