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 encodeDomainDTO2019242086(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeDomainDTO2019242086( 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 decodeDomainDTO2019242086(object);
      }
      
      private org.silverpeas.mobile.shared.dto.DomainDTO decodeDomainDTO2019242086(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;
      }
      
    }
