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

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

public class PasswordControlDTO_Generated_JsonEncoderDecoder_ extends org.fusesource.restygwt.client.AbstractJsonEncoderDecoder<org.silverpeas.mobile.shared.dto.password.PasswordControlDTO> {
  
  public static final PasswordControlDTO_Generated_JsonEncoderDecoder_ INSTANCE = new PasswordControlDTO_Generated_JsonEncoderDecoder_();
  
  public com.google.gwt.json.client.JSONValue encode(org.silverpeas.mobile.shared.dto.password.PasswordControlDTO value) {
    if( value==null ) {
      return getNullType();
    }
      return encodePasswordControlDTO1730002374(value);
    }
    
    private com.google.gwt.json.client.JSONValue encodePasswordControlDTO1730002374( org.silverpeas.mobile.shared.dto.password.PasswordControlDTO value) {
      com.google.gwt.json.client.JSONObject rc = new com.google.gwt.json.client.JSONObject();
      org.silverpeas.mobile.shared.dto.password.PasswordControlDTO parseValue = (org.silverpeas.mobile.shared.dto.password.PasswordControlDTO)value;
      isNotNullValuePut(toJSON(parseValue.getRequiredRuleIdsInError(), STRING), rc, "requiredRuleIdsInError");
      isNotNullValuePut(toJSON(parseValue.getCombinedRuleIdsInError(), STRING), rc, "combinedRuleIdsInError");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isRuleCombinationRespected), rc, "isRuleCombinationRespected");
      isNotNullValuePut(BOOLEAN.encode(parseValue.isCorrect), rc, "isCorrect");
      return rc;
    }
    
    public org.silverpeas.mobile.shared.dto.password.PasswordControlDTO 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 decodePasswordControlDTO1730002374(object);
      }
      
      private org.silverpeas.mobile.shared.dto.password.PasswordControlDTO decodePasswordControlDTO1730002374(com.google.gwt.json.client.JSONObject object) {
        org.silverpeas.mobile.shared.dto.password.PasswordControlDTO rc = new org.silverpeas.mobile.shared.dto.password.PasswordControlDTO();
        rc.setRequiredRuleIdsInError(getValueToSet(toArray(object.get("requiredRuleIdsInError"), STRING, new java.lang.String[org.fusesource.restygwt.client.AbstractJsonEncoderDecoder.getSize(object.get("requiredRuleIdsInError"))]), null));
        rc.setCombinedRuleIdsInError(getValueToSet(toArray(object.get("combinedRuleIdsInError"), STRING, new java.lang.String[org.fusesource.restygwt.client.AbstractJsonEncoderDecoder.getSize(object.get("combinedRuleIdsInError"))]), null));
        rc.setIsRuleCombinationRespected(getValueToSet(BOOLEAN.decode(object.get("isRuleCombinationRespected")), false));
        rc.setIsCorrect(getValueToSet(BOOLEAN.decode(object.get("isCorrect")), false));
        return rc;
      }
      
    }
