public BsonArrayBuilder(@NotMutable List<BsonValue<?>> list) { this.list = list; built = false; }
public ListBsonArray(@NotMutable List<BsonValue<?>> list) { this.list = list; }
public ListBasedBsonDocument(@NotMutable List<Entry<?>> entries) { this.entries = entries; }
public MapBasedBsonDocument(@NotMutable LinkedHashMap<String, BsonValue<?>> map) { this.map = map; }
public CollectionBatch(@NotMutable Collection<? extends T> collection, long fetchTime) { if (collection instanceof List) { this.list = Collections.unmodifiableList((List<? extends T>) collection); } else { this.list = Collections.unmodifiableList(new ArrayList<>(collection)); } this.it = collection.iterator(); this.batchSize = collection.size(); this.fetchTime = fetchTime; }
public static final BsonDocument newDocument( @NotMutable LinkedHashMap<String, BsonValue<?>> map) { switch (map.size()) { case 0: return EMPTY_DOC; case 1: { java.util.Map.Entry<String, BsonValue<?>> entry = map.entrySet().iterator().next(); return new SingleEntryBsonDocument(entry.getKey(), entry.getValue()); } default: return new MapBasedBsonDocument(map); } }
public static final BsonDocument newDocument(@NotMutable List<Entry<?>> list) { switch (list.size()) { case 0: return EMPTY_DOC; case 1: Entry<?> entry = list.get(0); return new SingleEntryBsonDocument(entry.getKey(), entry.getValue()); default: return new ListBasedBsonDocument(list); } }