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

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

public class ResourceDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.reservations.ResourceDTO> {
  
  public static final ResourceDTO_Generated_JsonEncoderDecoder_ INSTANCE = new ResourceDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.reservations.ResourceDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeResourceDTO1896755924(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeResourceDTO1896755924( org.silverpeas.mobile.shared.dto.reservations.ResourceDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.reservations.ResourceDTO parseValue = (org.silverpeas.mobile.shared.dto.reservations.ResourceDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      isNotNullValuePut(STRING.encode(parseValue.getCategoryId()), rc, "categoryId");
      isNotNullValuePut(STRING.encode(parseValue.getCategoryName()), rc, "categoryName");
      isNotNullValuePut(STRING.encode(parseValue.getDescription()), rc, "description");
      isNotNullValuePut(STRING.encode(parseValue.getReservationStatus()), rc, "reservationStatus");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.reservations.ResourceDTO 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 decodeResourceDTO1896755924(object);
      }
      
      private org.silverpeas.mobile.shared.dto.reservations.ResourceDTO decodeResourceDTO1896755924(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.reservations.ResourceDTO rc = new org.silverpeas.mobile.shared.dto.reservations.ResourceDTO();
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        rc.setCategoryId(getValueToSet(STRING.decode(object.get("categoryId")), null));
        rc.setCategoryName(getValueToSet(STRING.decode(object.get("categoryName")), null));
        rc.setDescription(getValueToSet(STRING.decode(object.get("description")), null));
        rc.setReservationStatus(getValueToSet(STRING.decode(object.get("reservationStatus")), null));
        return rc;
      }
      
    }
