package org.silverpeas.mobile.shared.dto;

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

public class ShortCutLinkDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.ShortCutLinkDTO> {
  
  public static final ShortCutLinkDTO_Generated_JsonEncoderDecoder_ INSTANCE = new ShortCutLinkDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.ShortCutLinkDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeShortCutLinkDTO665045667(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeShortCutLinkDTO665045667( org.silverpeas.mobile.shared.dto.ShortCutLinkDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.ShortCutLinkDTO parseValue = (org.silverpeas.mobile.shared.dto.ShortCutLinkDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getUrl()), rc, "url");
      isNotNullValuePut(STRING.encode(parseValue.getText()), rc, "text");
      isNotNullValuePut(STRING.encode(parseValue.getIcon()), rc, "icon");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.ShortCutLinkDTO 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 decodeShortCutLinkDTO665045667(object);
      }
      
      private org.silverpeas.mobile.shared.dto.ShortCutLinkDTO decodeShortCutLinkDTO665045667(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.ShortCutLinkDTO rc = new org.silverpeas.mobile.shared.dto.ShortCutLinkDTO();
        rc.setUrl(getValueToSet(STRING.decode(object.get("url")), null));
        rc.setText(getValueToSet(STRING.decode(object.get("text")), null));
        rc.setIcon(getValueToSet(STRING.decode(object.get("icon")), null));
        return rc;
      }
      
    }
