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

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

public class CalendarEventAttributeDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO> {
  
  public static final CalendarEventAttributeDTO_Generated_JsonEncoderDecoder_ INSTANCE = new CalendarEventAttributeDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeCalendarEventAttributeDTO98775694(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeCalendarEventAttributeDTO98775694( org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO parseValue = (org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      isNotNullValuePut(STRING.encode(parseValue.getValue()), rc, "value");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO 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 decodeCalendarEventAttributeDTO98775694(object);
      }
      
      private org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO decodeCalendarEventAttributeDTO98775694(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO rc = new org.silverpeas.mobile.shared.dto.almanach.CalendarEventAttributeDTO();
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        rc.setValue(getValueToSet(STRING.decode(object.get("value")), null));
        return rc;
      }
      
    }
