org.springframework.data.repository.core.support

## Class AbstractRepositoryMetadata

- java.lang.Object
- - org.springframework.data.repository.core.support.AbstractRepositoryMetadata

All Implemented Interfaces:
  RepositoryMetadata

Direct Known Subclasses:
  AnnotationRepositoryMetadata, DefaultRepositoryMetadata

    public abstract class AbstractRepositoryMetadata
    extends Object
    implements RepositoryMetadata

Base class for `RepositoryMetadata` implementations.

Author:
  Oliver Gierke, Thomas Darimont, Jens Schauder, Mark Paluch

### Constructor Summary

Constructors
Constructor and Description
`AbstractRepositoryMetadata(Class<?> repositoryInterface)` Creates a new `AbstractRepositoryMetadata`.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Set<Class<?>>` `getAlternativeDomainTypes()` Returns the set of types the repository shall be discoverable for when trying to look up a repository by domain type.
`CrudMethods` `getCrudMethods()` Returns `CrudMethods` meta information for the repository.
`static RepositoryMetadata` `getMetadata(Class<?> repositoryInterface)` Creates a new `RepositoryMetadata` for the given repository interface.
`Class<?>` `getRepositoryInterface()` Returns the repository interface.
`Class<?>` `getReturnedDomainClass(Method method)` Returns the domain class returned by the given `Method`.
`TypeInformation<?>` `getReturnType(Method method)` Returns the type `Method` return type as it is declared in the repository.
`boolean` `isPagingRepository()` Returns whether the repository is a paging one.
`boolean` `isReactiveRepository()` Returns whether the repository is a reactive one, i.e. if it uses reactive types in one of its methods.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.springframework.data.repository.core.RepositoryMetadata

`getDomainType, getIdType`

### Constructor Detail

#### AbstractRepositoryMetadata

    public AbstractRepositoryMetadata(Class<?> repositoryInterface)

Creates a new `AbstractRepositoryMetadata`.

Parameters:
  `repositoryInterface` - must not be null and must be an interface.

### Method Detail

#### getMetadata

    public static RepositoryMetadata getMetadata(Class<?> repositoryInterface)

Creates a new `RepositoryMetadata` for the given repository interface.

Parameters:
  `repositoryInterface` - must not be null.
Returns:
Since:
  1.9

#### getReturnType

    public TypeInformation<?> getReturnType(Method method)

Description copied from interface: `RepositoryMetadata`
Returns the type `Method` return type as it is declared in the repository. Considers suspended methods and does not unwrap component types but leaves those for further inspection.

Specified by:
  `getReturnType` in interface `RepositoryMetadata`
Returns:

#### getReturnedDomainClass

    public Class<?> getReturnedDomainClass(Method method)

Description copied from interface: `RepositoryMetadata`
Returns the domain class returned by the given `Method`. In contrast to `RepositoryMetadata.getReturnType(Method)`, this method extracts the type from `Collection`s and `Page` as well.

Specified by:
  `getReturnedDomainClass` in interface `RepositoryMetadata`
Returns:
See Also:
  `RepositoryMetadata.getReturnType(Method)`

#### getRepositoryInterface

    public Class<?> getRepositoryInterface()

Description copied from interface: `RepositoryMetadata`
Returns the repository interface.

Specified by:
  `getRepositoryInterface` in interface `RepositoryMetadata`
Returns:

#### getCrudMethods

    public CrudMethods getCrudMethods()

Description copied from interface: `RepositoryMetadata`
Returns `CrudMethods` meta information for the repository.

Specified by:
  `getCrudMethods` in interface `RepositoryMetadata`
Returns:

#### isPagingRepository

    public boolean isPagingRepository()

Description copied from interface: `RepositoryMetadata`
Returns whether the repository is a paging one.

Specified by:
  `isPagingRepository` in interface `RepositoryMetadata`
Returns:

#### getAlternativeDomainTypes

    public Set<Class<?>> getAlternativeDomainTypes()

Description copied from interface: `RepositoryMetadata`
Returns the set of types the repository shall be discoverable for when trying to look up a repository by domain type.

Specified by:
  `getAlternativeDomainTypes` in interface `RepositoryMetadata`
Returns:
  the set of types the repository shall be discoverable for when trying to look up a repository by domain type, must not be null.
See Also:
  `Repositories.getRepositoryFor(Class)`

#### isReactiveRepository

    public boolean isReactiveRepository()

Description copied from interface: `RepositoryMetadata`
Returns whether the repository is a reactive one, i.e. if it uses reactive types in one of its methods.

Specified by:
  `isReactiveRepository` in interface `RepositoryMetadata`
Returns: