package org.silverpeas.mobile.shared.dto.almanach;

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

public class AttachmentParameterDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO> {
  
  public static final AttachmentParameterDTO_Generated_JsonEncoderDecoder_ INSTANCE = new AttachmentParameterDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeAttachmentParameterDTO1927796821(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeAttachmentParameterDTO1927796821( org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO parseValue = (org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      isNotNullValuePut(STRING.encode(parseValue.getValue()), rc, "value");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO 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 decodeAttachmentParameterDTO1927796821(object);
      }
      
      private org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO decodeAttachmentParameterDTO1927796821(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO rc = new org.silverpeas.mobile.shared.dto.almanach.AttachmentParameterDTO();
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        rc.setValue(getValueToSet(STRING.decode(object.get("value")), null));
        return rc;
      }
      
    }
