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

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

public class NotificationReceivedDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO> {
  
  public static final NotificationReceivedDTO_Generated_JsonEncoderDecoder_ INSTANCE = new NotificationReceivedDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeNotificationReceivedDTO1698808934(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeNotificationReceivedDTO1698808934( org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO parseValue = (org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO)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(STRING.encode(parseValue.getAuthor()), rc, "author");
      isNotNullValuePut(INT.encode(parseValue.getReaden()), rc, "readen");
      isNotNullValuePut(LONG.encode(parseValue.getIdNotif()), rc, "idNotif");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isSended()), rc, "sended");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO 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 decodeNotificationReceivedDTO1698808934(object);
      }
      
      private org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO decodeNotificationReceivedDTO1698808934(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO rc = new org.silverpeas.mobile.shared.dto.notifications.NotificationReceivedDTO();
        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.setAuthor(getValueToSet(STRING.decode(object.get("author")), null));
        rc.setReaden(getValueToSet(INT.decode(object.get("readen")), 0));
        rc.setIdNotif(getValueToSet(LONG.decode(object.get("idNotif")), 0L));
        rc.setSended(getValueToSet(BOOLEAN.decode(object.get("sended")), false));
        return rc;
      }
      
    }
