Class RepositoryComposition.RepositoryFragments
java.lang.Object
org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments
- All Implemented Interfaces:
Iterable<RepositoryFragment<?>>
,Supplier<Stream<RepositoryFragment<?>>>
,Streamable<RepositoryFragment<?>>
- Enclosing class:
- RepositoryComposition
public static class RepositoryComposition.RepositoryFragments
extends Object
implements Streamable<RepositoryFragment<?>>
Value object representing an ordered list of
fragments
.- Author:
- Mark Paluch, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionappend
(RepositoryComposition.RepositoryFragments fragments) Create newRepositoryComposition.RepositoryFragments
from the current content appendingRepositoryComposition.RepositoryFragments
.append
(RepositoryFragment<?> fragment) Create newRepositoryComposition.RepositoryFragments
from the current content appendingRepositoryFragment
.empty()
Create emptyRepositoryComposition.RepositoryFragments
.boolean
from
(List<RepositoryFragment<?>> fragments) int
hashCode()
InvokeMethod
by resolving the fragment that implements a suitable method.iterator()
CreateRepositoryComposition.RepositoryFragments
from just implementation objects.methods()
of
(RepositoryFragment<?>... fragments) CreateRepositoryComposition.RepositoryFragments
fromfragments
.int
size()
Returns the number offragments
available.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
empty
Create emptyRepositoryComposition.RepositoryFragments
.- Returns:
- empty
RepositoryComposition.RepositoryFragments
.
-
just
CreateRepositoryComposition.RepositoryFragments
from just implementation objects.- Parameters:
implementations
- must not be null.- Returns:
- the
RepositoryComposition.RepositoryFragments
forimplementations
.
-
of
CreateRepositoryComposition.RepositoryFragments
fromfragments
.- Parameters:
fragments
- must not be null.- Returns:
- the
RepositoryComposition.RepositoryFragments
forimplementations
.
-
from
- Parameters:
fragments
- must not be null.- Returns:
- the
RepositoryComposition.RepositoryFragments
forimplementations
.
-
append
Create newRepositoryComposition.RepositoryFragments
from the current content appendingRepositoryFragment
.- Parameters:
fragment
- must not be null- Returns:
- the new
RepositoryComposition.RepositoryFragments
containing all existing fragments and the givenRepositoryFragment
as last element.
-
append
public RepositoryComposition.RepositoryFragments append(RepositoryComposition.RepositoryFragments fragments) Create newRepositoryComposition.RepositoryFragments
from the current content appendingRepositoryComposition.RepositoryFragments
.- Parameters:
fragments
- must not be null- Returns:
- the new
RepositoryComposition.RepositoryFragments
containing all existing fragments and the givenRepositoryComposition.RepositoryFragments
as last elements.
-
iterator
- Specified by:
iterator
in interfaceIterable<RepositoryFragment<?>>
-
methods
-
invoke
@Nullable public Object invoke(Method invokedMethod, Method methodToCall, Object[] args) throws Throwable InvokeMethod
by resolving the fragment that implements a suitable method.- Parameters:
invokedMethod
- invoked method as per invocation on the interface.methodToCall
- backend method that is backing the call.- Returns:
- Throws:
Throwable
-
size
public int size()Returns the number offragments
available.- Returns:
- the number of
fragments
. - Since:
- 2.5
-
toString
-
equals
-
hashCode
public int hashCode()
-