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

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

public class CalendarEventAttendeeDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO> {
  
  public static final CalendarEventAttendeeDTO_Generated_JsonEncoderDecoder_ INSTANCE = new CalendarEventAttendeeDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeCalendarEventAttendeeDTO527138347(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeCalendarEventAttendeeDTO527138347( org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO parseValue = (org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getFullName()), rc, "fullName");
      if(isNotNullAndCheckDefaults(parseValue.getParticipationStatus(), rc, "participationStatus")) {
        isNotNullValuePut(org.silverpeas.mobile.shared.dto.almanach.ParticipationStatusDTO_Generated_JsonEncoderDecoder_.INSTANCE.encode(parseValue.getParticipationStatus()), rc, "participationStatus");
      }
      if(isNotNullAndCheckDefaults(parseValue.getPresenceStatus(), rc, "presenceStatus")) {
        isNotNullValuePut(org.silverpeas.mobile.shared.dto.almanach.PresenceStatusDTO_Generated_JsonEncoderDecoder_.INSTANCE.encode(parseValue.getPresenceStatus()), rc, "presenceStatus");
      }
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO 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 decodeCalendarEventAttendeeDTO527138347(object);
      }
      
      private org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO decodeCalendarEventAttendeeDTO527138347(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO rc = new org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttendeeDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setFullName(getValueToSet(STRING.decode(object.get("fullName")), null));
        rc.setParticipationStatus(getValueToSet(org.silverpeas.mobile.shared.dto.almanach.ParticipationStatusDTO_Generated_JsonEncoderDecoder_.INSTANCE.decode(object.get("participationStatus")), null));
        rc.setPresenceStatus(getValueToSet(org.silverpeas.mobile.shared.dto.almanach.PresenceStatusDTO_Generated_JsonEncoderDecoder_.INSTANCE.decode(object.get("presenceStatus")), null));
        return rc;
      }
      
    }
