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

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

public class CalendarEventRecurrenceDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO> {
  
  public static final CalendarEventRecurrenceDTO_Generated_JsonEncoderDecoder_ INSTANCE = new CalendarEventRecurrenceDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeCalendarEventRecurrenceDTO2087468902(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeCalendarEventRecurrenceDTO2087468902( org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO parseValue = (org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO)value;
      isNotNullValuePut(org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO_FrequencyDTO_Generated_JsonEncoderDecoder_.INSTANCE.encode(parseValue.getFrequency()), rc, "frequency");
      isNotNullValuePut(INT.encode(parseValue.getCount()), rc, "count");
      isNotNullValuePut(STRING.encode(parseValue.getEndDate()), rc, "endDate");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO 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 decodeCalendarEventRecurrenceDTO2087468902(object);
      }
      
      private org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO decodeCalendarEventRecurrenceDTO2087468902(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO rc = new org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO();
        rc.setFrequency(getValueToSet(org.silverpeas.mobile.shared.dto.almanach.CalendarEventRecurrenceDTO_FrequencyDTO_Generated_JsonEncoderDecoder_.INSTANCE.decode(object.get("frequency")), null));
        rc.setCount(getValueToSet(INT.decode(object.get("count")), 0));
        rc.setEndDate(getValueToSet(STRING.decode(object.get("endDate")), null));
        return rc;
      }
      
    }
