app/src/main/java/com/mensa/zhmensa/services/PollApi.java
/**
     * Converts a Poll Object to a JsonObject that can be sent to the Server as payload
     * @param poll
     * @return
     */
Converts a Poll Object to a JsonObject that can be sent to the Server as payload
@param poll
@return
Converts a Poll Object to a JsonObject that can be sent to the Server as payload @param poll @return
private static JsonObject convertPollToJsonObj(Poll poll) {
          JsonObject payload = new JsonObject();
          payload.addProperty("title", poll.label);
          payload.addProperty("weekday", poll.weekday.day);
          payload.addProperty("mealType", poll.menuCategory.toString());
          JsonArray options = new JsonArray();
          for(Poll.PollOption pOption: poll.getOptions()) {
              JsonObject option = new JsonObject();
              option.addProperty("mensaId", pOption.id.mensaName);
              option.addProperty("menuId", pOption.id.menuId);
              options.add(option);
          }
          payload.add("options", options);
          return payload;
      }
private static JsonObject convertPollToJsonObj ( Poll poll ) { JsonObject payload = new JsonObject ( ) ; payload . addProperty ( "title" , poll . label ) ; payload . addProperty ( "weekday" , poll . weekday . day ) ; payload . addProperty ( "mealType" , poll . menuCategory . toString ( ) ) ; JsonArray options = new JsonArray ( ) ; for ( Poll . PollOption pOption : poll . getOptions ( ) ) { JsonObject option = new JsonObject ( ) ; option . addProperty ( "mensaId" , pOption . id . mensaName ) ; option . addProperty ( "menuId" , pOption . id . menuId ) ; options . add ( option ) ; } payload . add ( "options" , options ) ; return payload ; }
Converts a Poll Object to a JsonObject that can be sent to the Server as payload
 @param poll
 @return
Converts a Poll Object to a JsonObject that can be sent to the Server as payload @param poll @return