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

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

public class WorkflowInstancePresentationFormDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO> {
  
  public static final WorkflowInstancePresentationFormDTO_Generated_JsonEncoderDecoder_ INSTANCE = new WorkflowInstancePresentationFormDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeWorkflowInstancePresentationFormDTO2101645748(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeWorkflowInstancePresentationFormDTO2101645748( org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO parseValue = (org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getInstanceId()), rc, "instanceId");
      isNotNullValuePut(toJSON(parseValue.getFields(), org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO_Generated_JsonEncoderDecoder_.INSTANCE), rc, "fields");
      isNotNullValuePut(toJSON(parseValue.getActions(), STRING, STRING, org.fusesource.restygwt.client.Json.Style.DEFAULT), rc, "actions");
      isNotNullValuePut(STRING.encode(parseValue.getTitle()), rc, "title");
      isNotNullValuePut(STRING.encode(parseValue.getState()), rc, "state");
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO 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 decodeWorkflowInstancePresentationFormDTO2101645748(object);
      }
      
      private org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO decodeWorkflowInstancePresentationFormDTO2101645748(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO rc = new org.silverpeas.mobile.shared.dto.workflow.WorkflowInstancePresentationFormDTO();
        rc.setInstanceId(getValueToSet(STRING.decode(object.get("instanceId")), null));
        rc.setFields(getValueToSet(toList(object.get("fields"), org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO_Generated_JsonEncoderDecoder_.INSTANCE), null));
        rc.setActions(getValueToSet(toMap(object.get("actions"), STRING, STRING, org.fusesource.restygwt.client.Json.Style.DEFAULT), null));
        rc.setTitle(getValueToSet(STRING.decode(object.get("title")), null));
        rc.setState(getValueToSet(STRING.decode(object.get("state")), null));
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        return rc;
      }
      
    }
