package org.silverpeas.mobile.shared.dto;

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

public class MyLinkCategoryDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO> {
  
  public static final MyLinkCategoryDTO_Generated_JsonEncoderDecoder_ INSTANCE = new MyLinkCategoryDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeMyLinkCategoryDTO2099661942(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeMyLinkCategoryDTO2099661942( org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO parseValue = (org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getCatId()), rc, "catId");
      isNotNullValuePut(STRING.encode(parseValue.getPosition()), rc, "position");
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      isNotNullValuePut(STRING.encode(parseValue.getUserId()), rc, "userId");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO 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 decodeMyLinkCategoryDTO2099661942(object);
      }
      
      private org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO decodeMyLinkCategoryDTO2099661942(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO rc = new org.silverpeas.mobile.shared.dto.MyLinkCategoryDTO();
        rc.setCatId(getValueToSet(STRING.decode(object.get("catId")), null));
        rc.setPosition(getValueToSet(STRING.decode(object.get("position")), null));
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        rc.setUserId(getValueToSet(STRING.decode(object.get("userId")), null));
        return rc;
      }
      
    }
