Polishing.

Improve factory methods. Integrate auditing hints in AuditingBeanRegistrationAotProcessor. Reduce visibility, improve naming.

Original Pull Request: #2624
This commit is contained in:
Mark Paluch
2022-07-01 11:07:52 +02:00
committed by Christoph Strobl
parent 7aafe577e2
commit 9c3696d335
8 changed files with 89 additions and 129 deletions

View File

@@ -16,6 +16,7 @@
package org.springframework.data.domain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
@@ -31,6 +32,7 @@ import org.springframework.util.Assert;
*
* @author Christoph Strobl
* @author John Blum
* @author Mark Paluch
* @since 3.0
*/
@FunctionalInterface
@@ -47,6 +49,16 @@ public interface ManagedTypes {
return fromIterable(Collections.emptySet());
}
/**
* Factory method used to construct {@link ManagedTypes} from the given array of {@link Class types}.
*
* @param types array of {@link Class types} used to initialize the {@link ManagedTypes}; must not be {@literal null}.
* @return new instance of {@link ManagedTypes} initialized from {@link Class types}.
*/
static ManagedTypes from(Class<?>... types) {
return fromIterable(Arrays.asList(types));
}
/**
* Factory method used to construct {@link ManagedTypes} from the given, required {@link Iterable} of {@link Class
* types}.