/** * Helper method to create either a BSON Object or a BSON List depending upon whether the {@code array} parameter is true or not. * * @param array set to true to create a new BSON List, otherwise will create a new BSONObject * @param path a list of field names to navigate to this field in the document * @return the new BSONObject */ public BSONObject create(final boolean array, final List<String> path) { return array ? createList() : create(); }
public BSONObject create(boolean array, List<String> path) { if (array) return createList(); return create(); }