Module spring.data.mongodb
Interface CollectionPreparer<T>
public interface CollectionPreparer<T>
Interface for functional preparation of a
MongoCollection.- Since:
- 4.1
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptiondefault CollectionPreparer<T>andThen(CollectionPreparer<T> after) Returns a composedCollectionPreparerthat first applies this preparer to the collection, and then applies theafterpreparer to the result.static <T> CollectionPreparer<T>identity()Returns a preparer that always returns its input collection.Prepare thecollection.
-
Method Details
-
identity
Returns a preparer that always returns its input collection.- Returns:
- a preparer that always returns its input collection.
-
prepare
Prepare thecollection.- Parameters:
collection- the collection to prepare.- Returns:
- the prepared collection.
-
andThen
Returns a composedCollectionPreparerthat first applies this preparer to the collection, and then applies theafterpreparer to the result. If evaluation of either function throws an exception, it is relayed to the caller of the composed function.- Parameters:
after- the collection preparer to apply after this function is applied.- Returns:
- a composed
CollectionPreparerthat first applies this preparer and then applies theafterpreparer.
-