package org.silverpeas.mobile.shared.dto;

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

public class DomainDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.DomainDTO> {
  
  public static final DomainDTO_Generated_JsonEncoderDecoder_ INSTANCE = new DomainDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.DomainDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeDomainDTO891465998(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeDomainDTO891465998( org.silverpeas.mobile.shared.dto.DomainDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.DomainDTO parseValue = (org.silverpeas.mobile.shared.dto.DomainDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.DomainDTO 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 decodeDomainDTO891465998(object);
      }
      
      private org.silverpeas.mobile.shared.dto.DomainDTO decodeDomainDTO891465998(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.DomainDTO rc = new org.silverpeas.mobile.shared.dto.DomainDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        return rc;
      }
      
    }
