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

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

public class ContactFilters_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.contact.ContactFilters> {
  
  public static final ContactFilters_Generated_JsonEncoderDecoder_ INSTANCE = new ContactFilters_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.contact.ContactFilters value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeContactFilters260334333(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeContactFilters260334333( org.silverpeas.mobile.shared.dto.contact.ContactFilters value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.contact.ContactFilters parseValue = (org.silverpeas.mobile.shared.dto.contact.ContactFilters)value;
      isNotNullValuePut(BOOLEAN.encode(parseValue.isHasContacts()), rc, "hasContacts");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isHasPersonnalContacts()), rc, "hasPersonnalContacts");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.contact.ContactFilters 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 decodeContactFilters260334333(object);
      }
      
      private org.silverpeas.mobile.shared.dto.contact.ContactFilters decodeContactFilters260334333(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.contact.ContactFilters rc = new org.silverpeas.mobile.shared.dto.contact.ContactFilters();
        rc.setHasContacts(getValueToSet(BOOLEAN.decode(object.get("hasContacts")), false));
        rc.setHasPersonnalContacts(getValueToSet(BOOLEAN.decode(object.get("hasPersonnalContacts")), false));
        return rc;
      }
      
    }
