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

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

public class SimpleDocumentDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO> {
  
  public static final SimpleDocumentDTO_Generated_JsonEncoderDecoder_ INSTANCE = new SimpleDocumentDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeSimpleDocumentDTO1343108875(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeSimpleDocumentDTO1343108875( org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO parseValue = (org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getInstanceId()), rc, "instanceId");
      isNotNullValuePut(STRING.encode(parseValue.getFileName()), rc, "fileName");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      isNotNullValuePut(STRING.encode(parseValue.getContentType()), rc, "contentType");
      isNotNullValuePut(STRING.encode(parseValue.getUpdatedBy()), rc, "updatedBy");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getCreatedBy()), rc, "createdBy");
      isNotNullValuePut(STRING.encode(parseValue.getLang()), rc, "lang");
      isNotNullValuePut(STRING.encode(parseValue.getIcon()), rc, "icon");
      isNotNullValuePut(STRING.encode(parseValue.getPermalink()), rc, "permalink");
      isNotNullValuePut(STRING.encode(parseValue.getDownloadUrl()), rc, "downloadUrl");
      isNotNullValuePut(STRING.encode(parseValue.getVersioned()), rc, "versioned");
      isNotNullValuePut(STRING.encode(parseValue.getComment()), rc, "comment");
      isNotNullValuePut(LONG.encode(parseValue.getSize()), rc, "size");
      isNotNullValuePut(LONG.encode(parseValue.getCreationDate()), rc, "creationDate");
      isNotNullValuePut(LONG.encode(parseValue.getUpdateDate()), rc, "updateDate");
      isNotNullValuePut(STRING.encode(parseValue.getSpId()), rc, "spId");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isDownloadable()), rc, "downloadable");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO 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 decodeSimpleDocumentDTO1343108875(object);
      }
      
      private org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO decodeSimpleDocumentDTO1343108875(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO rc = new org.silverpeas.mobile.shared.dto.documents.SimpleDocumentDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setInstanceId(getValueToSet(STRING.decode(object.get("instanceId")), null));
        rc.setFileName(getValueToSet(STRING.decode(object.get("fileName")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        rc.setContentType(getValueToSet(STRING.decode(object.get("contentType")), null));
        rc.setUpdatedBy(getValueToSet(STRING.decode(object.get("updatedBy")), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setCreatedBy(getValueToSet(STRING.decode(object.get("createdBy")), null));
        rc.setLang(getValueToSet(STRING.decode(object.get("lang")), null));
        rc.setIcon(getValueToSet(STRING.decode(object.get("icon")), null));
        rc.setPermalink(getValueToSet(STRING.decode(object.get("permalink")), null));
        rc.setDownloadUrl(getValueToSet(STRING.decode(object.get("downloadUrl")), null));
        rc.setVersioned(getValueToSet(STRING.decode(object.get("versioned")), null));
        rc.setComment(getValueToSet(STRING.decode(object.get("comment")), null));
        rc.setSize(getValueToSet(LONG.decode(object.get("size")), 0L));
        rc.setCreationDate(getValueToSet(LONG.decode(object.get("creationDate")), 0L));
        rc.setUpdateDate(getValueToSet(LONG.decode(object.get("updateDate")), 0L));
        rc.setSpId(getValueToSet(STRING.decode(object.get("spId")), null));
        rc.setDownloadable(getValueToSet(BOOLEAN.decode(object.get("downloadable")), false));
        return rc;
      }
      
    }
