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

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

public class CategoryDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.faq.CategoryDTO> {
  
  public static final CategoryDTO_Generated_JsonEncoderDecoder_ INSTANCE = new CategoryDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.faq.CategoryDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeCategoryDTO286480029(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeCategoryDTO286480029( org.silverpeas.mobile.shared.dto.faq.CategoryDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.faq.CategoryDTO parseValue = (org.silverpeas.mobile.shared.dto.faq.CategoryDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.faq.CategoryDTO 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 decodeCategoryDTO286480029(object);
      }
      
      private org.silverpeas.mobile.shared.dto.faq.CategoryDTO decodeCategoryDTO286480029(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.faq.CategoryDTO rc = new org.silverpeas.mobile.shared.dto.faq.CategoryDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        return rc;
      }
      
    }
