Class RepositoryComposition


public class RepositoryComposition extends Object
Composite implementation to back repository method implementations.

A RepositoryComposition represents an ordered collection of fragments. Each fragment contributes executable method signatures that are used by this composition to route method calls into the according RepositoryFragment.

Fragments are allowed to contribute multiple implementations for a single method signature exposed through the repository interface. MethodLookup selects the first matching method for invocation. A composition also supports argument conversion between the repository method signature and fragment implementation method through withArgumentConverter(BiFunction). Use argument conversion with a single implementation method that can be exposed accepting convertible types.

Composition objects are immutable and thread-safe.

Mark Paluch, Christoph Strobl, Johannes Englmeier
See Also: