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

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

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