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

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

public class VideoStreamingDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO> {
  
  public static final VideoStreamingDTO_Generated_JsonEncoderDecoder_ INSTANCE = new VideoStreamingDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeVideoStreamingDTO1249277119(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeVideoStreamingDTO1249277119( org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      com.google.gwt.json.client.JSONValue className=STRING.encode("VideoStreamingDTO");
      if( className!=null ) { 
        rc.put("@class", className);
      }
      org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO parseValue = (org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getDuration()), rc, "duration");
      isNotNullValuePut(STRING.encode(parseValue.getUrl()), rc, "url");
      isNotNullValuePut(STRING.encode(parseValue.getUrlPoster()), rc, "urlPoster");
      isNotNullValuePut(BOOLEAN.encode(parseValue.getDownload()), rc, "download");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      isNotNullValuePut(STRING.encode(parseValue.getUpdateDate()), rc, "updateDate");
      isNotNullValuePut(STRING.encode(parseValue.getUpdater()), rc, "updater");
      isNotNullValuePut(STRING.encode(parseValue.getCreator()), rc, "creator");
      isNotNullValuePut(STRING.encode(parseValue.getCreationDate()), rc, "creationDate");
      isNotNullValuePut(INT.encode(parseValue.getCommentsNumber()), rc, "commentsNumber");
      isNotNullValuePut(STRING.encode(parseValue.getInstance()), rc, "instance");
      isNotNullValuePut(STRING.encode(parseValue.getMimeType()), rc, "mimeType");
      isNotNullValuePut(LONG.encode(parseValue.getSize()), rc, "size");
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO 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 decodeVideoStreamingDTO1249277119(object);
      }
      
      private org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO decodeVideoStreamingDTO1249277119(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO rc = new org.silverpeas.mobile.shared.dto.media.VideoStreamingDTO();
        rc.setDuration(getValueToSet(STRING.decode(object.get("duration")), null));
        rc.setUrl(getValueToSet(STRING.decode(object.get("url")), null));
        rc.setUrlPoster(getValueToSet(STRING.decode(object.get("urlPoster")), null));
        rc.setDownload(getValueToSet(BOOLEAN.decode(object.get("download")), false));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        rc.setUpdateDate(getValueToSet(STRING.decode(object.get("updateDate")), null));
        rc.setUpdater(getValueToSet(STRING.decode(object.get("updater")), null));
        rc.setCreator(getValueToSet(STRING.decode(object.get("creator")), null));
        rc.setCreationDate(getValueToSet(STRING.decode(object.get("creationDate")), null));
        rc.setCommentsNumber(getValueToSet(INT.decode(object.get("commentsNumber")), 0));
        rc.setInstance(getValueToSet(STRING.decode(object.get("instance")), null));
        rc.setMimeType(getValueToSet(STRING.decode(object.get("mimeType")), null));
        rc.setSize(getValueToSet(LONG.decode(object.get("size")), 0L));
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        return rc;
      }
      
    }
