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

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

public class TicketDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.tickets.TicketDTO> {
  
  public static final TicketDTO_Generated_JsonEncoderDecoder_ INSTANCE = new TicketDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.tickets.TicketDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeTicketDTO2031941922(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeTicketDTO2031941922( org.silverpeas.mobile.shared.dto.tickets.TicketDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.tickets.TicketDTO parseValue = (org.silverpeas.mobile.shared.dto.tickets.TicketDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getSharedObjectId()), rc, "sharedObjectId");
      isNotNullValuePut(STRING.encode(parseValue.getSharedObjectType()), rc, "sharedObjectType");
      isNotNullValuePut(STRING.encode(parseValue.getComponentId()), rc, "componentId");
      isNotNullValuePut(STRING.encode(parseValue.getValidity()), rc, "validity");
      isNotNullValuePut(STRING.encode(parseValue.getUrl()), rc, "url");
      isNotNullValuePut(STRING.encode(parseValue.getUri()), rc, "uri");
      isNotNullValuePut(STRING.encode(parseValue.getEndDateStr()), rc, "endDateStr");
      isNotNullValuePut(STRING.encode(parseValue.getEndDateFormat()), rc, "endDateFormat");
      isNotNullValuePut(STRING.encode(parseValue.getNbAccessMax()), rc, "nbAccessMax");
      isNotNullValuePut(STRING.encode(parseValue.getUsers()), rc, "users");
      isNotNullValuePut(STRING.encode(parseValue.getExternalEmails()), rc, "externalEmails");
      isNotNullValuePut(STRING.encode(parseValue.getAdditionalMessage()), rc, "additionalMessage");
      isNotNullValuePut(STRING.encode(parseValue.getCreationDate()), rc, "creationDate");
      isNotNullValuePut(STRING.encode(parseValue.getNbAccess()), rc, "nbAccess");
      isNotNullValuePut(STRING.encode(parseValue.getToken()), rc, "token");
      isNotNullValuePut(STRING.encode(parseValue.getValid()), rc, "valid");
      isNotNullValuePut(STRING.encode(parseValue.getModified()), rc, "modified");
      isNotNullValuePut(STRING.encode(parseValue.getContinuous()), rc, "continuous");
      isNotNullValuePut(STRING.encode(parseValue.getName()), rc, "name");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.tickets.TicketDTO 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 decodeTicketDTO2031941922(object);
      }
      
      private org.silverpeas.mobile.shared.dto.tickets.TicketDTO decodeTicketDTO2031941922(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.tickets.TicketDTO rc = new org.silverpeas.mobile.shared.dto.tickets.TicketDTO();
        rc.setSharedObjectId(getValueToSet(STRING.decode(object.get("sharedObjectId")), null));
        rc.setSharedObjectType(getValueToSet(STRING.decode(object.get("sharedObjectType")), null));
        rc.setComponentId(getValueToSet(STRING.decode(object.get("componentId")), null));
        rc.setValidity(getValueToSet(STRING.decode(object.get("validity")), null));
        rc.setUrl(getValueToSet(STRING.decode(object.get("url")), null));
        rc.setUri(getValueToSet(STRING.decode(object.get("uri")), null));
        rc.setEndDateStr(getValueToSet(STRING.decode(object.get("endDateStr")), null));
        rc.setEndDateFormat(getValueToSet(STRING.decode(object.get("endDateFormat")), null));
        rc.setNbAccessMax(getValueToSet(STRING.decode(object.get("nbAccessMax")), null));
        rc.setUsers(getValueToSet(STRING.decode(object.get("users")), null));
        rc.setExternalEmails(getValueToSet(STRING.decode(object.get("externalEmails")), null));
        rc.setAdditionalMessage(getValueToSet(STRING.decode(object.get("additionalMessage")), null));
        rc.setCreationDate(getValueToSet(STRING.decode(object.get("creationDate")), null));
        rc.setNbAccess(getValueToSet(STRING.decode(object.get("nbAccess")), null));
        rc.setToken(getValueToSet(STRING.decode(object.get("token")), null));
        rc.setValid(getValueToSet(STRING.decode(object.get("valid")), null));
        rc.setModified(getValueToSet(STRING.decode(object.get("modified")), null));
        rc.setContinuous(getValueToSet(STRING.decode(object.get("continuous")), null));
        rc.setName(getValueToSet(STRING.decode(object.get("name")), null));
        return rc;
      }
      
    }
