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

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

public class UserProfileDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO> {
  
  public static final UserProfileDTO_Generated_JsonEncoderDecoder_ INSTANCE = new UserProfileDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodeUserProfileDTO556726930(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodeUserProfileDTO556726930( org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO parseValue = (org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO)value;
      isNotNullValuePut(STRING.encode(parseValue.getUri()), rc, "uri");
      isNotNullValuePut(STRING.encode(parseValue.getContactsUri()), rc, "contactsUri");
      isNotNullValuePut(STRING.encode(parseValue.getWebPage()), rc, "webPage");
      isNotNullValuePut(STRING.encode(parseValue.getAvatar()), rc, "avatar");
      isNotNullValuePut(STRING.encode(parseValue.getDomainName()), rc, "domainName");
      isNotNullValuePut(STRING.encode(parseValue.getFullName()), rc, "fullName");
      isNotNullValuePut(STRING.encode(parseValue.getLanguage()), rc, "language");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isConnected()), rc, "connected");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isAnonymous()), rc, "anonymous");
      isNotNullValuePut(STRING.encode(parseValue.getApiToken()), rc, "apiToken");
      isNotNullValuePut(STRING.encode(parseValue.getId()), rc, "id");
      isNotNullValuePut(STRING.encode(parseValue.getSpecificId()), rc, "specificId");
      isNotNullValuePut(STRING.encode(parseValue.getDomainId()), rc, "domainId");
      isNotNullValuePut(STRING.encode(parseValue.getLogin()), rc, "login");
      isNotNullValuePut(STRING.encode(parseValue.getFirstName()), rc, "firstName");
      isNotNullValuePut(STRING.encode(parseValue.getLastName()), rc, "lastName");
      isNotNullValuePut(STRING.encode(parseValue.geteMail()), rc, "eMail");
      isNotNullValuePut(STRING.encode(parseValue.getAccessLevel()), rc, "accessLevel");
      isNotNullValuePut(STRING.encode(parseValue.getStatus()), rc, "status");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isDeletedState()), rc, "deletedState");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isDeactivatedState()), rc, "deactivatedState");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO 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 decodeUserProfileDTO556726930(object);
      }
      
      private org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO decodeUserProfileDTO556726930(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO rc = new org.silverpeas.mobile.shared.dto.authentication.UserProfileDTO();
        rc.setUri(getValueToSet(STRING.decode(object.get("uri")), null));
        rc.setContactsUri(getValueToSet(STRING.decode(object.get("contactsUri")), null));
        rc.setWebPage(getValueToSet(STRING.decode(object.get("webPage")), null));
        rc.setAvatar(getValueToSet(STRING.decode(object.get("avatar")), null));
        rc.setDomainName(getValueToSet(STRING.decode(object.get("domainName")), null));
        rc.setFullName(getValueToSet(STRING.decode(object.get("fullName")), null));
        rc.setLanguage(getValueToSet(STRING.decode(object.get("language")), null));
        rc.setConnected(getValueToSet(BOOLEAN.decode(object.get("connected")), false));
        rc.setAnonymous(getValueToSet(BOOLEAN.decode(object.get("anonymous")), false));
        rc.setApiToken(getValueToSet(STRING.decode(object.get("apiToken")), null));
        rc.setId(getValueToSet(STRING.decode(object.get("id")), null));
        rc.setSpecificId(getValueToSet(STRING.decode(object.get("specificId")), null));
        rc.setDomainId(getValueToSet(STRING.decode(object.get("domainId")), null));
        rc.setLogin(getValueToSet(STRING.decode(object.get("login")), null));
        rc.setFirstName(getValueToSet(STRING.decode(object.get("firstName")), null));
        rc.setLastName(getValueToSet(STRING.decode(object.get("lastName")), null));
        rc.seteMail(getValueToSet(STRING.decode(object.get("eMail")), null));
        rc.setAccessLevel(getValueToSet(STRING.decode(object.get("accessLevel")), null));
        rc.setStatus(getValueToSet(STRING.decode(object.get("status")), null));
        rc.setDeletedState(getValueToSet(BOOLEAN.decode(object.get("deletedState")), false));
        rc.setDeactivatedState(getValueToSet(BOOLEAN.decode(object.get("deactivatedState")), false));
        return rc;
      }
      
    }
