Package com.massivecraft.mcore.xlib.gson

Examples of com.massivecraft.mcore.xlib.gson.JsonArray


 
  public static List<FireworkEffect> convertFireworkEffectList(JsonElement jsonElement)
  {
    if (jsonElement == null) return null;
    if ( ! jsonElement.isJsonArray()) return null;
    JsonArray array = jsonElement.getAsJsonArray();
   
    List<FireworkEffect> ret = new ArrayList<FireworkEffect>();
   
    Iterator<JsonElement> iter = array.iterator();
    while(iter.hasNext())
    {
      FireworkEffect fe = FireworkEffectAdapter.fromJson(iter.next());
      if (fe == null) continue;
      ret.add(fe);
View Full Code Here


  // MINI UTILS
  // -------------------------------------------- //
 
  public static JsonArray fromColorCollection(Collection<Color> colors)
  {
    JsonArray ret = new JsonArray();
    for (Color color : colors)
    {
      ret.add(new JsonPrimitive(color.asRGB()));
    }
    return ret;
  }
View Full Code Here

    return ret;
  }
 
  public static List<Color> toColorCollection(JsonElement json)
  {
    JsonArray array = json.getAsJsonArray();
    List<Color> ret = new ArrayList<Color>();
   
    Iterator<JsonElement> iter = array.iterator();
    while (iter.hasNext())
    {
      JsonElement element = iter.next();
      ret.add(Color.fromRGB(element.getAsInt()));
    }
View Full Code Here

TOP

Related Classes of com.massivecraft.mcore.xlib.gson.JsonArray

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.