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

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

public class AnswerDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.survey.AnswerDTO> {
  
  public static final AnswerDTO_Generated_JsonEncoderDecoder_ INSTANCE = new AnswerDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.survey.AnswerDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeAnswerDTO1856944298(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeAnswerDTO1856944298( org.silverpeas.mobile.shared.dto.survey.AnswerDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.survey.AnswerDTO parseValue = (org.silverpeas.mobile.shared.dto.survey.AnswerDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getLabel()), rc, "label");
      isNotNullValuePut(STRING.encode(parseValue.getComments()), rc, "comments");
      isNotNullValuePut(STRING.encode(parseValue.getImage()), rc, "image");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.survey.AnswerDTO 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 decodeAnswerDTO1856944298(object);
      }
      
      private org.silverpeas.mobile.shared.dto.survey.AnswerDTO decodeAnswerDTO1856944298(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.survey.AnswerDTO rc = new org.silverpeas.mobile.shared.dto.survey.AnswerDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setLabel(getValueToSet(STRING.decode(object.get("label")), null));
        rc.setComments(getValueToSet(STRING.decode(object.get("comments")), null));
        rc.setImage(getValueToSet(STRING.decode(object.get("image")), null));
        return rc;
      }
      
    }
