boolean remove()

in src/main/java/org/apache/sling/validation/impl/ValidatorMap.java [212:231]


    boolean remove(String id, ServiceReference<Validator<?>> serviceReference) {
        // only actually remove if the service reference is equal
        if (id == null) {
            // find by service reference
        }
        ValidatorMetadata entry = validatorMap.get(id);
        if (entry == null) {
            LOG.warn("Could not remove validator with id '{}' from map, because it is not there!", id);
            return false;
        } else {
            // only actually remove if the service reference is equal
            if (entry.serviceReference.equals(serviceReference)) {
                validatorMap.remove(id);
                return true;
            } else {
                LOG.warn("Could not remove validator with id '{}' from map because it is only contained with a different service reference!", id);
                return false;
            }
        }
    }