public int getInt(final String key, final int def) { final Object foo = this.get(key); if (foo == null) { return def; } return BSON.toInt(foo); }
public int getInt(final String key) { final Object o = this.get(key); if (o == null) { throw new NullPointerException("no value for: " + key); } return BSON.toInt(o); }