Example usage for com.mongodb BasicDBList BasicDBList

List of usage examples for com.mongodb BasicDBList BasicDBList

Introduction

In this page you can find the example usage for com.mongodb BasicDBList BasicDBList.

Prototype

BasicDBList

Source Link

Usage

From source file:com.gigaspaces.persistency.metadata.DefaultSpaceDocumentMapper.java

License:Open Source License

private BasicDBList toArray(Object property) {
    BasicDBList builder = new BasicDBList();

    int length = Array.getLength(property);

    builder.add(property.getClass().getName());

    for (int i = 0; i < length; i++) {
        Object obj = toObject(Array.get(property, i));
        setArray(builder, obj);//from ww  w  .  j a v  a 2 s.  c  o  m
    }

    return builder;
}

From source file:com.gigaspaces.persistency.metadata.SpaceDocumentMapperImpl.java

License:Open Source License

private BasicDBList toMap(Object property) {

    BasicDBList list = new BasicDBList();

    @SuppressWarnings("rawtypes")
    Map<?, ?> map = (Map) property;
    int index = 0;
    list.add(index++, property.getClass().getName());

    for (Map.Entry<?, ?> entry : map.entrySet()) {
        list.add(index++, toObject(entry.getKey()));
        list.add(index++, toObject(entry.getValue()));
    }/*from   w ww.  j av  a  2s .  c  o m*/

    return list;
}

From source file:com.gigaspaces.persistency.metadata.SpaceDocumentMapperImpl.java

License:Open Source License

private BasicDBList toCollection(Object property) {
    BasicDBList list = new BasicDBList();

    @SuppressWarnings("rawtypes")
    Collection collection = (Collection) property;

    int index = 0;
    list.add(index++, property.getClass().getName());

    for (Object e : collection) {
        list.add(index++, toObject(e));// ww  w.  j a  v a2  s .  c  o m
    }

    return list;
}

From source file:com.gigaspaces.persistency.metadata.SpaceDocumentMapperImpl.java

License:Open Source License

private BasicDBList toArray(Object property) {
    BasicDBList list = new BasicDBList();

    Object[] array = (Object[]) property;

    list.add(0, property.getClass().getName());

    for (int i = 0; i < array.length; i++) {

        list.add(i + 1, toObject(array[i]));
    }//from  w ww  .  j a  va 2  s. c  o m

    return list;
}

From source file:com.googlecode.pongo.tests.ossmeter.model.GoogleForgeProject.java

License:Open Source License

public GoogleForgeProject() {
    super();//from www .  j  a  va2  s  .c  om
    dbObject.put("wiki", new BasicDBObject());
    dbObject.put("license", new BasicDBObject());
    dbObject.put("issues", new BasicDBList());
    dbObject.put("owners", new BasicDBList());
    dbObject.put("committers", new BasicDBList());
    dbObject.put("contributors", new BasicDBList());
    dbObject.put("downloads", new BasicDBList());
    super.setSuperTypes("com.googlecode.pongo.tests.ossmeter.model.Project",
            "com.googlecode.pongo.tests.ossmeter.model.NamedElement");
    NAME.setOwningType("com.googlecode.pongo.tests.ossmeter.model.GoogleForgeProject");
    DESCRIPTION.setOwningType("com.googlecode.pongo.tests.ossmeter.model.GoogleForgeProject");
    YEAR.setOwningType("com.googlecode.pongo.tests.ossmeter.model.GoogleForgeProject");
    ACTIVE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.GoogleForgeProject");
    STARS.setOwningType("com.googlecode.pongo.tests.ossmeter.model.GoogleForgeProject");
}

From source file:com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject.java

public SourceForgeProject() {
    super();/*from   w w  w.j av  a2 s  .  c o m*/
    dbObject.put("donation", new BasicDBObject());
    dbObject.put("license", new BasicDBList());
    dbObject.put("os", new BasicDBList());
    dbObject.put("topics", new BasicDBList());
    dbObject.put("programminLanguages", new BasicDBList());
    dbObject.put("audiences", new BasicDBList());
    dbObject.put("translations", new BasicDBList());
    dbObject.put("environments", new BasicDBList());
    dbObject.put("categories", new BasicDBList());
    dbObject.put("trackers", new BasicDBList());
    dbObject.put("maintainers", new BasicDBList());
    dbObject.put("developers", new BasicDBList());
    super.setSuperTypes("com.googlecode.pongo.tests.ossmeter.model.Project",
            "com.googlecode.pongo.tests.ossmeter.model.NamedElement");
    NAME.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    DESCRIPTION.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    YEAR.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    ACTIVE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    CREATED.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    CREATEDTIMESTAMP.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    PROJECTID.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    _PRIVATE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    TYPE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    SHORTDESC.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    PERCENTILE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    RANKING.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    DOWNLOADPAGE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    SUPPORTPAGE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    SUMMARYPAGE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    HOMEPAGE.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
    BASEURL.setOwningType("com.googlecode.pongo.tests.ossmeter.model.SourceForgeProject");
}

From source file:com.groupon.jenkins.mongo.AxisListConverter.java

License:Open Source License

@Override
public Object encode(Object value, MappedField optionalExtraInfo) {
    if (value == null)
        return null;

    AxisList axisList = (AxisList) value;

    BasicDBList convertedList = new BasicDBList();

    for (Axis axis : axisList) {
        convertedList.add(getMapper().toDBObject(axis));
    }//from   w ww.j a  v a 2 s. c o m

    return convertedList;
}

From source file:com.groupon.jenkins.mongo.CauseActionConverter.java

License:Open Source License

@Override
public Object encode(Object value, MappedField optionalExtraInfo) {
    if (value == null)
        return null;
    CauseAction action = (CauseAction) value;
    List causes = new BasicDBList();

    for (Object obj : action.getCauses()) {
        causes.add(getMapper().toDBObject(obj));
    }// ww  w.j  av a 2 s .c o m
    return BasicDBObjectBuilder.start("causes", causes).add("className", CauseAction.class.getName()).get();
}

From source file:com.groupon.jenkins.mongo.CopyOnWriteListConverter.java

License:Open Source License

@Override
public Object encode(Object value, MappedField optionalExtraInfo) {
    if (value == null)
        return null;

    CopyOnWriteList copyOnWriteList = (CopyOnWriteList) value;
    List core = new BasicDBList();

    for (Object obj : copyOnWriteList) {
        core.add(getMapper().toDBObject(obj));
    }//w  ww . j av  a 2  s  .  c  o  m

    return core;
}

From source file:com.groupon.jenkins.mongo.DescribableListConverter.java

License:Open Source License

@Override
public Object encode(Object value, MappedField optionalExtraInfo) {
    if (value == null)
        return null;

    DescribableList describableList = (DescribableList) value;

    BasicDBList convertedList = new BasicDBList();

    for (Object obj : describableList.toList()) {
        convertedList.add(getMapper().toDBObject(obj));
    }//from w ww  .  j  a  v  a 2s  .  c  om

    return convertedList;
}