Fix for 5_0_x branch. (#1281)

Closes #1280.

Co-authored-by: mikereiche <michael.reiche@couchbase.com>
This commit is contained in:
Michael Reiche
2021-12-10 10:52:13 -08:00
committed by GitHub
parent 73eb49d851
commit 495ac13c6d

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors
* Copyright 2012-2021 the original author or authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,11 @@
package org.springframework.data.couchbase.core.mapping.event;
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.Validator;
import java.util.Set;
import jakarta.validation.ConstraintViolationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.couchbase.core.mapping.CouchbaseDocument;
@@ -33,19 +34,20 @@ import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
* @author Maciej Walkowiak
* @author Michael Nitschinger
* @author Mark Paluch
* @author Michael Reiche
*/
public class ValidatingCouchbaseEventListener extends AbstractCouchbaseEventListener<Object> {
private static final Logger LOG = LoggerFactory.getLogger(ValidatingCouchbaseEventListener.class);
private final LocalValidatorFactoryBean validator;
private final Validator validator;
/**
* Creates a new {@link ValidatingCouchbaseEventListener} using the given {@link Validator}.
*
* @param validator must not be {@literal null}.
*/
public ValidatingCouchbaseEventListener(LocalValidatorFactoryBean validator) {
public ValidatingCouchbaseEventListener(Validator validator) {
Assert.notNull(validator, "Validator must not be null!");
this.validator = validator;
}