@Override @SuppressWarnings("unchecked") public SavedSearch load(String id) throws NotFoundException { BasicDBObject o = (BasicDBObject) get(SavedSearchImpl.class, id); if (o == null) { throw new NotFoundException("Couldn't find saved search with ID " + id); } return new SavedSearchImpl((ObjectId) o.get("_id"), o.toMap()); }
@Override public Dashboard load(String id) throws NotFoundException { final BasicDBObject o = (BasicDBObject) get(DashboardImpl.class, id); if (o == null) { throw new NotFoundException("Couldn't find dashboard with ID " + id); } return this.create((ObjectId) o.get(DashboardImpl.FIELD_ID), o.toMap()); }
@Override public StreamRule load(String id) throws NotFoundException { BasicDBObject o = (BasicDBObject) get(StreamRuleImpl.class, new ObjectId(id)); if (o == null) { throw new NotFoundException("Couldn't find stream rule with ID" + id); } return new StreamRuleImpl((ObjectId) o.get("_id"), o.toMap()); }
/** * Creates a new instance which is a copy of this BasicDBObject. * * @return a BasicDBObject with exactly the same values as this instance. */ public Object copy() { // copy field values into new object BasicDBObject newCopy = new BasicDBObject(this.toMap()); // need to clone the sub obj for (final String field : keySet()) { Object val = get(field); if (val instanceof BasicDBObject) { newCopy.put(field, ((BasicDBObject) val).copy()); } else if (val instanceof BasicDBList) { newCopy.put(field, ((BasicDBList) val).copy()); } } return newCopy; }
((BasicDBObject) value).toMap()); break; case SET:
for (Map.Entry<?, ?> entry : ((Map<?, ?>) adUserDataDBO.toMap()).entrySet()) { atBuilder.userData(entry.getKey(), entry.getValue()); if (ftUserDataDBO != null) { Map<Object, Object> ftUserData = ft.getUserData(); for (Map.Entry<?, ?> entry : ((Map<?, ?>) ftUserDataDBO.toMap()).entrySet()) { ftUserData.put(entry.getKey(), entry.getValue());
/** * Applies all filters of this query to the given target. * * @param target the target to be supplied with the filters of this query */ public void transferFilters(QueryBuilder<?> target) { target.filterObject.clear(); target.filterObject.putAll(filterObject.toMap()); }
config: for (DBIndexConfig objectConfig : expectedIndexes) { @SuppressWarnings("unchecked") Set<Entry<?, ?>> entries = objectConfig.getKeys().toMap().entrySet(); Map<String, String> columns = new HashMap<>(); String name = objectConfig.getName();
Map<String, Object> originalMap = doc.toMap(); Map<String, Object> resultMap = new HashMap<>(doc.size()); for(Entry<String, Object> entry : originalMap.entrySet())
@Override @SuppressWarnings("unchecked") public SavedSearch load(String id) throws NotFoundException { BasicDBObject o = (BasicDBObject) get(SavedSearchImpl.class, id); if (o == null) { throw new NotFoundException("Couldn't find saved search with ID " + id); } return new SavedSearchImpl((ObjectId) o.get("_id"), o.toMap()); }
@Override public Dashboard load(String id) throws NotFoundException { final BasicDBObject o = (BasicDBObject) get(DashboardImpl.class, id); if (o == null) { throw new NotFoundException("Couldn't find dashboard with ID " + id); } final Dashboard dashboard = this.create((ObjectId) o.get("_id"), o.toMap()); return dashboard; }
@Override public StreamRule load(String id) throws NotFoundException { BasicDBObject o = (BasicDBObject) get(StreamRuleImpl.class, new ObjectId(id)); if (o == null) { throw new NotFoundException("Couldn't find stream rule with ID" + id); } return new StreamRuleImpl((ObjectId) o.get("_id"), o.toMap()); }
/** * Creates a new instance which is a copy of this BasicDBObject. * * @return a BasicDBObject with exactly the same values as this instance. */ public Object copy() { // copy field values into new object BasicDBObject newCopy = new BasicDBObject(this.toMap()); // need to clone the sub obj for (final String field : keySet()) { Object val = get(field); if (val instanceof BasicDBObject) { newCopy.put(field, ((BasicDBObject) val).copy()); } else if (val instanceof BasicDBList) { newCopy.put(field, ((BasicDBList) val).copy()); } } return newCopy; }
((BasicDBObject) value).toMap()); break; case SET: