package org.silverpeas.mobile.shared.dto;

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

public class PropertyDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.PropertyDTO> {
  
  public static final PropertyDTO_Generated_JsonEncoderDecoder_ INSTANCE = new PropertyDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.PropertyDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodePropertyDTO1762097839(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodePropertyDTO1762097839( org.silverpeas.mobile.shared.dto.PropertyDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.PropertyDTO parseValue = (org.silverpeas.mobile.shared.dto.PropertyDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getKey()), rc, "key");
      isNotNullValuePut(STRING.encode(parseValue.getValue()), rc, "value");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.PropertyDTO 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 decodePropertyDTO1762097839(object);
      }
      
      private org.silverpeas.mobile.shared.dto.PropertyDTO decodePropertyDTO1762097839(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.PropertyDTO rc = new org.silverpeas.mobile.shared.dto.PropertyDTO();
        rc.setKey(getValueToSet(STRING.decode(object.get("key")), null));
        rc.setValue(getValueToSet(STRING.decode(object.get("value")), null));
        return rc;
      }
      
    }
