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

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

public class FormLayerDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO> {
  
  public static final FormLayerDTO_Generated_JsonEncoderDecoder_ INSTANCE = new FormLayerDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeFormLayerDTO679065849(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeFormLayerDTO679065849( org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO parseValue = (org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getHtml()), rc, "html");
      isNotNullValuePut(toJSON(parseValue.getScripts(), STRING), rc, "scripts");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO 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 decodeFormLayerDTO679065849(object);
      }
      
      private org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO decodeFormLayerDTO679065849(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO rc = new org.silverpeas.mobile.shared.dto.formsonline.FormLayerDTO();
        rc.setHtml(getValueToSet(STRING.decode(object.get("html")), null));
        rc.setScripts(getValueToSet(toList(object.get("scripts"), STRING), null));
        return rc;
      }
      
    }
