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

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

public class NotificationDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.notifications.NotificationDTO> {
  
  public static final NotificationDTO_Generated_JsonEncoderDecoder_ INSTANCE = new NotificationDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.notifications.NotificationDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeNotificationDTO2091813675(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeNotificationDTO2091813675( org.silverpeas.mobile.shared.dto.notifications.NotificationDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.notifications.NotificationDTO parseValue = (org.silverpeas.mobile.shared.dto.notifications.NotificationDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getContentId()), rc, "contentId");
      isNotNullValuePut(STRING.encode(parseValue.getContentType()), rc, "contentType");
      isNotNullValuePut(STRING.encode(parseValue.getMessage()), rc, "message");
      isNotNullValuePut(STRING.encode(parseValue.getInstanceId()), rc, "instanceId");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.notifications.NotificationDTO 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 decodeNotificationDTO2091813675(object);
      }
      
      private org.silverpeas.mobile.shared.dto.notifications.NotificationDTO decodeNotificationDTO2091813675(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.notifications.NotificationDTO rc = new org.silverpeas.mobile.shared.dto.notifications.NotificationDTO();
        rc.setContentId(getValueToSet(STRING.decode(object.get("contentId")), null));
        rc.setContentType(getValueToSet(STRING.decode(object.get("contentType")), null));
        rc.setMessage(getValueToSet(STRING.decode(object.get("message")), null));
        rc.setInstanceId(getValueToSet(STRING.decode(object.get("instanceId")), null));
        return rc;
      }
      
    }
