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

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

public class ResultDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.search.ResultDTO> {
  
  public static final ResultDTO_Generated_JsonEncoderDecoder_ INSTANCE = new ResultDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.search.ResultDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeResultDTO1991135951(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeResultDTO1991135951( org.silverpeas.mobile.shared.dto.search.ResultDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.search.ResultDTO parseValue = (org.silverpeas.mobile.shared.dto.search.ResultDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getType()), rc, "type");
      isNotNullValuePut(STRING.encode(parseValue.getComponentId()), rc, "componentId");
      isNotNullValuePut(STRING.encode(parseValue.getAttachmentId()), rc, "attachmentId");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.search.ResultDTO 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 decodeResultDTO1991135951(object);
      }
      
      private org.silverpeas.mobile.shared.dto.search.ResultDTO decodeResultDTO1991135951(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.search.ResultDTO rc = new org.silverpeas.mobile.shared.dto.search.ResultDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setType(getValueToSet(STRING.decode(object.get("type")), null));
        rc.setComponentId(getValueToSet(STRING.decode(object.get("componentId")), null));
        rc.setAttachmentId(getValueToSet(STRING.decode(object.get("attachmentId")), null));
        return rc;
      }
      
    }
