Examples of toMap()


Examples of com.mongodb.DBObject.toMap()

        final DBObject o = findOne(InputImpl.class, new BasicDBObject("$and", query));
        if (o == null) {
            throw new NotFoundException();
        } else {
            return new InputImpl((ObjectId) o.get("_id"), o.toMap());
        }
    }

    @Override
    public Input findForThisRadio(String radioId, String id) throws NotFoundException {
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        if (o == null) {
            throw new NotFoundException("Output <" + streamOutputId + "> not found!");
        }

        return new OutputImpl((ObjectId) o.get("_id"), o.toMap());
    }

    @Override
    public Set<Output> loadAll() {
        return loadAll(new HashMap<String, Object>());
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        final DBObject o = findOne(InputImpl.class, new BasicDBObject("$and", query));
        if (o == null) {
            throw new NotFoundException();
        } else {
            return new InputImpl((ObjectId) o.get("_id"), o.toMap());
        }
    }

    @Override
    public void addExtractor(Input input, Extractor extractor) throws ValidationException {
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        DBObject result = findOne(MongoDbSession.class, query);
        if (result == null) {
            return null;
        }
        final Object objectId = result.get("_id");
        return new MongoDbSession((ObjectId) objectId, result.toMap());
    }

    @Override
    public Collection<MongoDbSession> loadAll() {
        DBObject query = new BasicDBObject();
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        DBObject dbo = findOne(IndexRangeImpl.class, new BasicDBObject("index", index));

        if (dbo == null)
            throw new NotFoundException("Index " + index + " not found.");

        return new IndexRangeImpl((ObjectId) dbo.get("_id"), dbo.toMap());
    }

    @Override
    public List<IndexRange> getFrom(int timestamp) {
        List<IndexRange> ranges = Lists.newArrayList();
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

            LOG.error("Multiple access tokens found, this is a serious bug.");
            throw new IllegalStateException("Access tokens collection has no unique index!");
        }
        final DBObject tokenObject = objects.get(0);
        final Object id = tokenObject.get("_id");
        return new AccessTokenImpl((ObjectId) id, tokenObject.toMap());
    }

    @Override
    @SuppressWarnings("unchecked")
    public List<AccessToken> loadAll(String username) {
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        final DBObject userObject = result.get(0);
        final Object userId = userObject.get("_id");

        LOG.debug("Loaded user {}/{} from MongoDB", username, userId);
        return new UserImpl((ObjectId) userId, userObject.toMap());
    }

    @Override
    public User create() {
        return new UserImpl(Maps.<String, Object>newHashMap());
View Full Code Here

Examples of com.mongodb.DBObject.toMap()

        if (value instanceof List) {
            return value;
        }
        if (value instanceof DBObject) {
            DBObject basicDBObject = (DBObject) value;
            return basicDBObject.toMap();
        }
        return value;
    }

}
View Full Code Here

Examples of com.mossle.user.support.UserBaseWrapper.toMap()

            }

            UserBaseWrapper userBaseWrapper = new UserBaseWrapper(userBase);

            result.setCode(200);
            result.setData(userBaseWrapper.toMap());

            return result;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument.toMap()

  public void testFromMapNotSaved() {
    final ODocument doc = new ODocument();
    doc.field("name", "Jay");
    doc.field("surname", "Miner");
    Map<String, Object> map = doc.toMap();

    Assert.assertEquals(map.size(), 2);
    Assert.assertEquals(map.get("name"), "Jay");
    Assert.assertEquals(map.get("surname"), "Miner");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.