package org.silverpeas.mobile.shared.dto.almanach;

import static org.fusesource.restygwt.client.AbstractJsonEncoderDecoder.*;

public class CalendarEventCreationDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO> {
  
  public static final CalendarEventCreationDTO_Generated_JsonEncoderDecoder_ INSTANCE = new CalendarEventCreationDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeCalendarEventCreationDTO1685117430(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeCalendarEventCreationDTO1685117430( org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO parseValue = (org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getEventType()), rc, "eventType");
      isNotNullValuePut(STRING.encode(parseValue.getOccurrenceType()), rc, "occurrenceType");
      isNotNullValuePut(STRING.encode(parseValue.getStartDate()), rc, "startDate");
      isNotNullValuePut(STRING.encode(parseValue.getEndDate()), rc, "endDate");
      isNotNullValuePut(STRING.encode(parseValue.getEventId()), rc, "eventId");
      isNotNullValuePut(org.silverpeas.mobile.shared.dto.almanach.CalendarDTO_Generated_JsonEncoderDecoder_.INSTANCE.encode(parseValue.getCalendar()), rc, "calendar");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(BOOLEAN.encode(parseValue.getOnAllDay()), rc, "onAllDay");
      isNotNullValuePut(STRING.encode(parseValue.getVisibility()), rc, "visibility");
      isNotNullValuePut(STRING.encode(parseValue.getPriority()), rc, "priority");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      isNotNullValuePut(org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO_Generated_JsonEncoderDecoder_.INSTANCE.encode(parseValue.getRecurrence()), rc, "recurrence");
      isNotNullValuePut(toJSON(parseValue.getAttendees(), org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO_Generated_JsonEncoderDecoder_.INSTANCE), rc, "attendees");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO decode(com.google.gwt.json.client.JSONValue value) {
      if( value == null || value.isNull()!=null ) {
        return null;
      }
      com.google.gwt.json.client.JSONObject object = toObject(value);
        return decodeCalendarEventCreationDTO1685117430(object);
      }
      
      private org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO decodeCalendarEventCreationDTO1685117430(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO rc = new org.silverpeas.mobile.shared.dto.almanach.CalendarEventCreationDTO();
        rc.setEventType(getValueToSet(STRING.decode(object.get("eventType")), null));
        rc.setOccurrenceType(getValueToSet(STRING.decode(object.get("occurrenceType")), null));
        rc.setStartDate(getValueToSet(STRING.decode(object.get("startDate")), null));
        rc.setEndDate(getValueToSet(STRING.decode(object.get("endDate")), null));
        rc.setEventId(getValueToSet(STRING.decode(object.get("eventId")), null));
        rc.setCalendar(getValueToSet(org.silverpeas.mobile.shared.dto.almanach.CalendarDTO_Generated_JsonEncoderDecoder_.INSTANCE.decode(object.get("calendar")), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setOnAllDay(getValueToSet(BOOLEAN.decode(object.get("onAllDay")), false));
        rc.setVisibility(getValueToSet(STRING.decode(object.get("visibility")), null));
        rc.setPriority(getValueToSet(STRING.decode(object.get("priority")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        rc.setRecurrence(getValueToSet(org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO_Generated_JsonEncoderDecoder_.INSTANCE.decode(object.get("recurrence")), null));
        rc.setAttendees(getValueToSet(toList(object.get("attendees"), org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO_Generated_JsonEncoderDecoder_.INSTANCE), null));
        return rc;
      }
      
    }
