package org.silverpeas.mobile.shared.dto;

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

public class MyLinkDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.MyLinkDTO> {
  
  public static final MyLinkDTO_Generated_JsonEncoderDecoder_ INSTANCE = new MyLinkDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.MyLinkDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeMyLinkDTO1578825387(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeMyLinkDTO1578825387( org.silverpeas.mobile.shared.dto.MyLinkDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.MyLinkDTO parseValue = (org.silverpeas.mobile.shared.dto.MyLinkDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getUri()), rc, "uri");
      isNotNullValuePut(INT.encode(parseValue.getLinkId()), rc, "linkId");
      isNotNullValuePut(INT.encode(parseValue.getPosition()), rc, "position");
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      isNotNullValuePut(STRING.encode(parseValue.getUrl()), rc, "url");
      isNotNullValuePut(BOOLEAN.encode(parseValue.getVisible()), rc, "visible");
      isNotNullValuePut(BOOLEAN.encode(parseValue.getPopup()), rc, "popup");
      isNotNullValuePut(STRING.encode(parseValue.getUserId()), rc, "userId");
      isNotNullValuePut(STRING.encode(parseValue.getInstanceId()), rc, "instanceId");
      isNotNullValuePut(STRING.encode(parseValue.getObjectId()), rc, "objectId");
      isNotNullValuePut(STRING.encode(parseValue.getCategoryId()), rc, "categoryId");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.MyLinkDTO 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 decodeMyLinkDTO1578825387(object);
      }
      
      private org.silverpeas.mobile.shared.dto.MyLinkDTO decodeMyLinkDTO1578825387(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.MyLinkDTO rc = new org.silverpeas.mobile.shared.dto.MyLinkDTO();
        rc.setUri(getValueToSet(STRING.decode(object.get("uri")), null));
        rc.setLinkId(getValueToSet(INT.decode(object.get("linkId")), 0));
        rc.setPosition(getValueToSet(INT.decode(object.get("position")), 0));
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        rc.setUrl(getValueToSet(STRING.decode(object.get("url")), null));
        rc.setVisible(getValueToSet(BOOLEAN.decode(object.get("visible")), false));
        rc.setPopup(getValueToSet(BOOLEAN.decode(object.get("popup")), false));
        rc.setUserId(getValueToSet(STRING.decode(object.get("userId")), null));
        rc.setInstanceId(getValueToSet(STRING.decode(object.get("instanceId")), null));
        rc.setObjectId(getValueToSet(STRING.decode(object.get("objectId")), null));
        rc.setCategoryId(getValueToSet(STRING.decode(object.get("categoryId")), null));
        return rc;
      }
      
    }
