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

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

public class NotificationSendedDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO> {
  
  public static final NotificationSendedDTO_Generated_JsonEncoderDecoder_ INSTANCE = new NotificationSendedDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeNotificationSendedDTO1083160278(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeNotificationSendedDTO1083160278( org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO parseValue = (org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getDate()), rc, "date");
      isNotNullValuePut(STRING.encode(parseValue.getLink()), rc, "link");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getSource()), rc, "source");
      isNotNullValuePut(LONG.encode(parseValue.getIdNotif()), rc, "idNotif");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isSended()), rc, "sended");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO 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 decodeNotificationSendedDTO1083160278(object);
      }
      
      private org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO decodeNotificationSendedDTO1083160278(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO rc = new org.silverpeas.mobile.shared.dto.notifications.NotificationSendedDTO();
        rc.setDate(getValueToSet(STRING.decode(object.get("date")), null));
        rc.setLink(getValueToSet(STRING.decode(object.get("link")), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setSource(getValueToSet(STRING.decode(object.get("source")), null));
        rc.setIdNotif(getValueToSet(LONG.decode(object.get("idNotif")), 0L));
        rc.setSended(getValueToSet(BOOLEAN.decode(object.get("sended")), false));
        return rc;
      }
      
    }
