Code example for Hashtable

Methods: containsKey, get, put

0
    } 
 
    private void setProperty(String key, String value) {
        if (key != null && value != null) {
            logger.debug("Setting propery.  key=" + key + " value=" + value);
            beProperties.put(key, value);
        } 
    } 
 
    private void inheritProperties(Hashtable inheritableProperties) {
 
        logger.debug("Setting inherited properties..."); 
        Iterator it = inheritableProperties.keySet().iterator();
        while (it.hasNext()) {
            String key = (String) it.next();
            if (!beProperties.containsKey(key)) {
                setProperty(key, (String) inheritableProperties.get(key));
            } 
        } 
    } 
 
    private void validateProperties() throws GeneralException { 
 
        logger.debug("Validating properties..."); 
        if (!beProperties.containsKey(CALL_BASIC_AUTH)) {
            setProperty(CALL_BASIC_AUTH, "false");
        } 
        if (!beProperties.containsKey(CALL_SSL)) {
            setProperty(CALL_SSL, "false");
        } 
        if (!beProperties.containsKey(CALLBACK_BASIC_AUTH)) {
            setProperty(CALLBACK_BASIC_AUTH, "false");
        } 
        if (!beProperties.containsKey(CALLBACK_SSL)) {
            setProperty(CALLBACK_SSL, "false");
        } 
        if (beProperties.get(CALL_BASIC_AUTH).equals("true")) {
            if (!beProperties.containsKey(CALL_USERNAME)) {
                throw new GeneralException("BackendSecurityDeserializer: " 
                        + "callBasicAuth is set to true, but callUsername is missing" 
                        + "for role of " + tmp_role);
            } 
            if (!beProperties.containsKey(CALL_PASSWORD)) {
                throw new GeneralException("BackendSecurityDeserializer: " 
                        + "callBasicAuth is set to true, but callPassword is missing" 
                        + "for role of " + tmp_role);
            } 
        }