Package com.massivecraft.mcore.xlib.gson

Examples of com.massivecraft.mcore.xlib.gson.JsonObject.entrySet()


  }

  @Override public void beginObject() throws IOException {
    expect(JsonToken.BEGIN_OBJECT);
    JsonObject object = (JsonObject) peekStack();
    stack.add(object.entrySet().iterator());
  }

  @Override public void endObject() throws IOException {
    expect(JsonToken.END_OBJECT);
    popStack(); // empty iterator
View Full Code Here


    final PSBuilder builder = new PSBuilder();
   
    if (jsonObject.has("world") && jsonObject.has("yaw"))
    {
      // Old Faction LazyLocation
      for (Entry<String, JsonElement> entry : jsonObject.entrySet())
      {
        final String key = entry.getKey();
        final JsonElement value = entry.getValue();
       
        switch(key)
View Full Code Here

      }
    }
    else
    {
      // The Standard Format
      for (Entry<String, JsonElement> entry : jsonObject.entrySet())
      {
        final String key = entry.getKey();
        final JsonElement value = entry.getValue();
       
        switch(key)
View Full Code Here

 
  public static BasicDBObject gson2MongoObject(JsonElement inElement)
  {
    JsonObject in = inElement.getAsJsonObject();
    BasicDBObject out = new BasicDBObject();
    for (Entry<String, JsonElement> entry : in.entrySet())
    {
      String key = gson2MongoKey(entry.getKey());
      JsonElement val = entry.getValue();
      if (val.isJsonArray())
      {
View Full Code Here

   
    // Cast to JsonObject
    JsonObject two = (JsonObject)twoObject;
   
    // Size must be the same
    if (one.entrySet().size() != two.entrySet().size()) return false;
   
    // And each entry must exist and be the same
    for (Entry<String, JsonElement> entry : one.entrySet())
    {
      if (!equals(entry.getValue(), two.get(entry.getKey()))) return false;
View Full Code Here

  {
    Map<PS, TerritoryAccess> ret = new ConcurrentSkipListMap<PS, TerritoryAccess>();
   
    JsonObject jsonObject = json.getAsJsonObject();
   
    for (Entry<String, JsonElement> entry : jsonObject.entrySet())
    {
      String[] ChunkCoordParts = entry.getKey().split("[,\\s]+");
      int chunkX = Integer.parseInt(ChunkCoordParts[0]);
      int chunkZ = Integer.parseInt(ChunkCoordParts[1]);
      PS chunk = PS.valueOf(chunkX, chunkZ);
View Full Code Here

 
  public static Map<Enchantment, Integer> convertEnchantLevelMap(JsonElement jsonElement)
  {
    JsonObject json = jsonElement.getAsJsonObject();
    Map<Enchantment, Integer> ret = new HashMap<Enchantment, Integer>();
    for (Entry<String, JsonElement> entry : json.entrySet())
    {
      int id = Integer.valueOf(entry.getKey());
      Enchantment ench = Enchantment.getById(id);
      int lvl = entry.getValue().getAsInt();
      ret.put(ench, lvl);
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.