Package com.massivecraft.mcore.xlib.mongodb

Examples of com.massivecraft.mcore.xlib.mongodb.BasicDBList


        return new BasicDBObject();
    }

    @Override
    protected BSONObject createList() {
        return new BasicDBList();
    }
View Full Code Here


  }
 
  public static BasicDBList gson2MongoArray(JsonElement inElement)
  {
    JsonArray in = inElement.getAsJsonArray();
    BasicDBList out = new BasicDBList();
    for (int i = 0; i < in.size(); i++)
    {
      JsonElement element = in.get(i);
      if (element.isJsonArray())
      {
        out.add(gson2MongoArray(element));
      }
      else if (element.isJsonObject())
      {
        out.add(gson2MongoObject(element));
      }
      else
      {
        out.add(gson2MongoPrimitive(element));
      }
    }
    return out;
  }
View Full Code Here

  }
 
  public static JsonArray mongo2GsonArray(DBObject inObject)
  {
    if (!(inObject instanceof BasicDBList)) throw new IllegalArgumentException("Expected BasicDBList as argument type!");
    BasicDBList in = (BasicDBList)inObject;
    JsonArray jsonArray = new JsonArray();
    for (int i = 0; i < in.size(); i++)
    {
      Object object = in.get(i);
      if (object instanceof BasicDBList)
      {
        jsonArray.add(mongo2GsonArray((BasicDBList) object));
      }
      else if (object instanceof BasicDBObject)
View Full Code Here

TOP

Related Classes of com.massivecraft.mcore.xlib.mongodb.BasicDBList

Copyright © 2018 www.massapicom. 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.