@Nonnull public static HostAndPort getHostAndPort(Entry<?> entry) throws TypesMismatchException { String string = getString(entry); return getHostAndPort(string); }
@Nullable public static String getString(BsonDocument doc, StringField field, String defaultValue) throws TypesMismatchException { return getString(doc, field.getFieldName(), defaultValue); }
@Nonnull public static String getString(BsonDocument doc, StringField field) throws TypesMismatchException, NoSuchKeyException { return getString(doc, field.getFieldName()); }
@Nonnull public static String getString(BsonDocument doc, String fieldId) throws TypesMismatchException, NoSuchKeyException { return getString(getEntry(doc, fieldId)); }
@Nullable public static String getString(BsonDocument doc, String fieldId, String defaultValue) throws TypesMismatchException { Entry<?> entry = doc.getEntry(fieldId); if (entry == null) { return defaultValue; } return getString(entry); }
public static CollectionCommandArgument unmarshall( BsonDocument requestDoc, Command command) throws BadValueException, TypesMismatchException, NoSuchKeyException { return new CollectionCommandArgument( BsonReaderTool.getString(requestDoc, command.getCommandName()), command ); }