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

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

public class FormRequestDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO> {
  
  public static final FormRequestDTO_Generated_JsonEncoderDecoder_ INSTANCE = new FormRequestDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeFormRequestDTO1542485367(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeFormRequestDTO1542485367( org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO parseValue = (org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getComments()), rc, "comments");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      isNotNullValuePut(STRING.encode(parseValue.getCreator()), rc, "creator");
      isNotNullValuePut(STRING.encode(parseValue.getCreationDate()), rc, "creationDate");
      isNotNullValuePut(STRING.encode(parseValue.getFormName()), rc, "formName");
      isNotNullValuePut(INT.encode(parseValue.getState()), rc, "state");
      isNotNullValuePut(STRING.encode(parseValue.getStateLabel()), rc, "stateLabel");
      isNotNullValuePut(STRING.encode(parseValue.getFormId()), rc, "formId");
      isNotNullValuePut(toJSON(parseValue.getData(), org.silverpeas.mobile.shared.dto.FormFieldDTO_Generated_JsonEncoderDecoder_.INSTANCE), rc, "data");
      isNotNullValuePut(INT.encode(parseValue.getValidator()), rc, "validator");
      isNotNullValuePut(org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO_Generated_JsonEncoderDecoder_.INSTANCE.encode(parseValue.getHtmlLayer()), rc, "htmlLayer");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO 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 decodeFormRequestDTO1542485367(object);
      }
      
      private org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO decodeFormRequestDTO1542485367(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO rc = new org.silverpeas.mobile.shared.dto.formsonline.FormRequestDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setComments(getValueToSet(STRING.decode(object.get("comments")), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        rc.setCreator(getValueToSet(STRING.decode(object.get("creator")), null));
        rc.setCreationDate(getValueToSet(STRING.decode(object.get("creationDate")), null));
        rc.setFormName(getValueToSet(STRING.decode(object.get("formName")), null));
        rc.setState(getValueToSet(INT.decode(object.get("state")), 0));
        rc.setStateLabel(getValueToSet(STRING.decode(object.get("stateLabel")), null));
        rc.setFormId(getValueToSet(STRING.decode(object.get("formId")), null));
        rc.setData(getValueToSet(toList(object.get("data"), org.silverpeas.mobile.shared.dto.FormFieldDTO_Generated_JsonEncoderDecoder_.INSTANCE), null));
        rc.setValidator(getValueToSet(INT.decode(object.get("validator")), 0));
        rc.setHtmlLayer(getValueToSet(org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO_Generated_JsonEncoderDecoder_.INSTANCE.decode(object.get("htmlLayer")), null));
        return rc;
      }
      
    }
