org.springframework.data.repository.core.support

## 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

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`RepositoryComposition.RepositoryFragments` `append(RepositoryComposition.RepositoryFragments fragments)` Create new `RepositoryComposition.RepositoryFragments` from the current content appending `RepositoryComposition.RepositoryFragments`.
`RepositoryComposition.RepositoryFragments` `append(RepositoryFragment<?> fragment)` Create new `RepositoryComposition.RepositoryFragments` from the current content appending `RepositoryFragment`.
`static RepositoryComposition.RepositoryFragments` `empty()` Create empty `RepositoryComposition.RepositoryFragments`.
`boolean` `equals(Object o)`
`static RepositoryComposition.RepositoryFragments` `from(List<RepositoryFragment<?>> fragments)` Create `RepositoryComposition.RepositoryFragments` from a `List` of `fragments`.
`int` `hashCode()`
`Object` `invoke(Method invokedMethod, Method methodToCall, Object[] args)` Invoke `Method` by resolving the fragment that implements a suitable method.
`Iterator<RepositoryFragment<?>>` `iterator()`
`static RepositoryComposition.RepositoryFragments` `just(Object... implementations)` Create `RepositoryComposition.RepositoryFragments` from just implementation objects.
`Stream<Method>` `methods()`
`static RepositoryComposition.RepositoryFragments` `of(RepositoryFragment<?>... fragments)` Create `RepositoryComposition.RepositoryFragments` from `fragments`.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.data.util.Streamable

`and, and, and, and, filter, flatMap, get, isEmpty, map, of, of, of, stream, toList, toSet, toStreamable, toStreamable`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

### Method Detail

#### empty

    public static RepositoryComposition.RepositoryFragments empty()

Create empty `RepositoryComposition.RepositoryFragments`.

Specified by:
  `empty` in interface `Streamable<RepositoryFragment<?>>`
Returns:
  empty `RepositoryComposition.RepositoryFragments`.

#### just

    public static RepositoryComposition.RepositoryFragments just(Object... implementations)

Create `RepositoryComposition.RepositoryFragments` from just implementation objects.

Parameters:
  `implementations` - must not be null.
Returns:
  the `RepositoryComposition.RepositoryFragments` for `implementations`.

#### of

    public static RepositoryComposition.RepositoryFragments of(RepositoryFragment<?>... fragments)

Create `RepositoryComposition.RepositoryFragments` from `fragments`.

Parameters:
  `fragments` - must not be null.
Returns:
  the `RepositoryComposition.RepositoryFragments` for `implementations`.

#### from

    public static RepositoryComposition.RepositoryFragments from(List<RepositoryFragment<?>> fragments)

Create `RepositoryComposition.RepositoryFragments` from a `List` of `fragments`.

Parameters:
  `fragments` - must not be null.
Returns:
  the `RepositoryComposition.RepositoryFragments` for `implementations`.

#### append

    public RepositoryComposition.RepositoryFragments append(RepositoryFragment<?> fragment)

Create new `RepositoryComposition.RepositoryFragments` from the current content appending `RepositoryFragment`.

Parameters:
  `fragment` - must not be null
Returns:
  the new `RepositoryComposition.RepositoryFragments` containing all existing fragments and the given `RepositoryFragment` as last element.

#### append

    public RepositoryComposition.RepositoryFragments append(RepositoryComposition.RepositoryFragments fragments)

Create new `RepositoryComposition.RepositoryFragments` from the current content appending `RepositoryComposition.RepositoryFragments`.

Parameters:
  `fragments` - must not be null
Returns:
  the new `RepositoryComposition.RepositoryFragments` containing all existing fragments and the given `RepositoryComposition.RepositoryFragments` as last elements.

#### iterator

    public Iterator<RepositoryFragment<?>> iterator()

Specified by:
  `iterator` in interface `Iterable<RepositoryFragment<?>>`

#### methods

    public Stream<Method> methods()

Returns:
  `Stream` of `methods`.

#### invoke

    @Nullable
    public Object invoke(Method invokedMethod,
                                   Method methodToCall,
                                   Object[] args)
                            throws Throwable

Invoke `Method` 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`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`