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

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

public class WorkflowFormActionDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO> {
  
  public static final WorkflowFormActionDTO_Generated_JsonEncoderDecoder_ INSTANCE = new WorkflowFormActionDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeWorkflowFormActionDTO97748925(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeWorkflowFormActionDTO97748925( org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO parseValue = (org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(toJSON(parseValue.getFields(), org.silverpeas.mobile.shared.dto.workflow.WorkflowFieldDTO_Generated_JsonEncoderDecoder_.INSTANCE), rc, "fields");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getActionName()), rc, "actionName");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO 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 decodeWorkflowFormActionDTO97748925(object);
      }
      
      private org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO decodeWorkflowFormActionDTO97748925(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO rc = new org.silverpeas.mobile.shared.dto.workflow.WorkflowFormActionDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setFields(getValueToSet(toList(object.get("fields"), org.silverpeas.mobile.shared.dto.workflow.WorkflowFieldDTO_Generated_JsonEncoderDecoder_.INSTANCE), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setActionName(getValueToSet(STRING.decode(object.get("actionName")), null));
        return rc;
      }
      
    }
