code: public static <T extends MPBase> JsonObject getJsonFromResource(T resourceObject) {
          return (JsonObject) gson.toJsonTree(resourceObject);
      }
docs: Static method that transforms all attributes members of the instance in a JSON Object.
  
  @return                  a JSON Object with the attributes members of the instance