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

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

public class FieldPresentationDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO> {
  
  public static final FieldPresentationDTO_Generated_JsonEncoderDecoder_ INSTANCE = new FieldPresentationDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeFieldPresentationDTO1244497556(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeFieldPresentationDTO1244497556( org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO parseValue = (org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getLabel()), rc, "label");
      isNotNullValuePut(STRING.encode(parseValue.getValue()), rc, "value");
      isNotNullValuePut(STRING.encode(parseValue.getType()), rc, "type");
      isNotNullValuePut(STRING.encode(parseValue.getDisplayerName()), rc, "displayerName");
      isNotNullValuePut(STRING.encode(parseValue.getInstanceId()), rc, "instanceId");
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO 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 decodeFieldPresentationDTO1244497556(object);
      }
      
      private org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO decodeFieldPresentationDTO1244497556(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO rc = new org.silverpeas.mobile.shared.dto.workflow.FieldPresentationDTO();
        rc.setLabel(getValueToSet(STRING.decode(object.get("label")), null));
        rc.setValue(getValueToSet(STRING.decode(object.get("value")), null));
        rc.setType(getValueToSet(STRING.decode(object.get("type")), null));
        rc.setDisplayerName(getValueToSet(STRING.decode(object.get("displayerName")), null));
        rc.setInstanceId(getValueToSet(STRING.decode(object.get("instanceId")), null));
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        return rc;
      }
      
    }
