private <T> void validateAttributeProperty(ClusterSpec.Id id,
                                                      Attribute current, Attribute next,
                                                      Function<Attribute, T> settingValueProvider, String setting,
                                                      List<VespaConfigChangeAction> result) {
        T currentValue = settingValueProvider.apply(current);
        T nextValue = settingValueProvider.apply(next);
        if ( ! Objects.equals(currentValue, nextValue)) {
            String message = String.format("change property '%s' from '%s' to '%s'", setting, currentValue, nextValue);
            if (hasHnswIndex(current) && hasHnswIndex(next))
                deployState.validationOverrides()
                           .invalid(ValidationId.hnswSettingsChange,
                                    message + ". This requires the hnsw index to be rebuilt during initialization, which may take a long time",
                                    deployState.now());
            result.add(new VespaRestartAction(id, new ChangeMessageBuilder(next.getName()).addChange(message).build()));
        }
    }
Validates the changes between the current and next set of attribute fields in a document database.

@author geirst
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/search/AttributeChangeValidator.java