com.mongodb.BasicDBObject.toMap()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中com.mongodb.BasicDBObject.toMap()方法的一些代码示例,展示了BasicDBObject.toMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BasicDBObject.toMap()方法的具体详情如下:
包路径:com.mongodb.BasicDBObject
类名称:BasicDBObject
方法名:toMap

BasicDBObject.toMap介绍

暂无

代码示例

代码示例来源:origin: Graylog2/graylog2-server

@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());
}

代码示例来源:origin: Graylog2/graylog2-server

@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());
}

代码示例来源:origin: Graylog2/graylog2-server

@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());
}

代码示例来源:origin: org.mongodb/mongo-java-driver

/**
 * 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;
}

代码示例来源:origin: Impetus/Kundera

((BasicDBObject) value).toMap());
  break;
case SET:

代码示例来源:origin: geotools/geotools

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());

代码示例来源:origin: com.scireum/sirius-db

/**
 * 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());
}

代码示例来源:origin: pl.edu.icm.synat/synat-core-services-impl

config: for (DBIndexConfig objectConfig : expectedIndexes) {
  @SuppressWarnings("unchecked")
  Set<Entry<?, ?>> entries = objectConfig.getKeys().toMap().entrySet();
  Map<String, String> columns = new HashMap<>();
  String name = objectConfig.getName();

代码示例来源:origin: stackoverflow.com

Map<String, Object> originalMap = doc.toMap();
Map<String, Object> resultMap = new HashMap<>(doc.size());  
for(Entry<String, Object> entry : originalMap.entrySet())

代码示例来源:origin: org.graylog2/graylog2-server

@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());
}

代码示例来源:origin: org.graylog2/graylog2-server

@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;
}

代码示例来源:origin: org.graylog2/graylog2-server

@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());
}

代码示例来源:origin: org.mongodb/mongodb-driver-core

/**
 * 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;
}

代码示例来源:origin: com.impetus.kundera.client/kundera-mongo

((BasicDBObject) value).toMap());
  break;
case SET:

相关文章