code: @SuppressWarnings("unchecked") 
      public Map marshal() {
          HashMap map = new HashMap();
          map.put("jsonrpc", "2.0");
          if (id != null)
              map.put("id", id);
          if (error != null)
              map.put("error", error.toMap());
          else
              map.put("result", result);
          return map;
      }
docs: Marshals this response to a Map that can be serialized