code: public static Attributes fromJSON(Model mo, JSONObject o) throws JSONConverterException {
          Attributes attrs = new DefaultAttributes();
          try {
  
              JSONObject vms = (JSONObject) o.get("vms");
              if (vms != null) {
                  for (Map.Entry<String, Object> e : vms.entrySet()) {
                      String el = e.getKey();
                      VM vm = getVM(mo, Integer.parseInt(el));
                      JSONObject entries = (JSONObject) e.getValue();
                      putAttributes(attrs, vm, entries);
                  }
              }
  
              JSONObject nodes = (JSONObject) o.get("nodes");
              if (nodes != null) {
                  for (Map.Entry<String, Object> e : nodes.entrySet()) {
                      String el = e.getKey();
                      Node n = getNode(mo, Integer.parseInt(el));
                      JSONObject entries = (JSONObject) e.getValue();
                      putAttributes(attrs, n, entries);
                  }
              }
          } catch (ClassCastException ex) {
              throw new JSONConverterException(ex);
          }
          return attrs;
      }
docs: Decode attributes
  
  @param mo the model to rely on
  @param o  the encoded attributes
  @return the resulting attributes
  @throws JSONConverterException if the conversion failed