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 encodeCategoryDTO1579101147(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeCategoryDTO1579101147( 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 decodeCategoryDTO1579101147(object);
      }
      
      private org.silverpeas.mobile.shared.dto.faq.CategoryDTO decodeCategoryDTO1579101147(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;
      }
      
    }
