org.springframework.data.repository.support

## Class DomainClassConverter<T extends ConversionService & ConverterRegistry>

- java.lang.Object
- - org.springframework.data.repository.support.DomainClassConverter<T>

All Implemented Interfaces:
  Aware, ApplicationContextAware, ConditionalConverter, ConditionalGenericConverter, GenericConverter

    public class DomainClassConverter<T extends ConversionService & ConverterRegistry>
    extends Object
    implements ConditionalGenericConverter, ApplicationContextAware

`Converter` to convert arbitrary input into domain classes managed by Spring Data `CrudRepository`s. The implementation uses a `ConversionService` in turn to convert the source type into the domain class' id type which is then converted into a domain class object by using a `CrudRepository`.

Author:
  Oliver Gierke, Thomas Darimont

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverter

`GenericConverter.ConvertiblePair`

### Constructor Summary

Constructors
Constructor and Description
`DomainClassConverter(T conversionService)` Creates a new `DomainClassConverter` for the given `ConversionService`.

### Method Summary

All Methods Instance Methods Concrete Methods
`Object` `convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)`
`Set<GenericConverter.ConvertiblePair>` `getConvertibleTypes()`
`boolean` `matches(TypeDescriptor sourceType, TypeDescriptor targetType)`
`void` `setApplicationContext(ApplicationContext context)`

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

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

### Constructor Detail

#### DomainClassConverter

    public DomainClassConverter(T conversionService)

Creates a new `DomainClassConverter` for the given `ConversionService`.

Parameters:
  `conversionService` - must not be null.

### Method Detail

#### getConvertibleTypes

    @Nonnull
    public Set<GenericConverter.ConvertiblePair> getConvertibleTypes()

Specified by:
  `getConvertibleTypes` in interface `GenericConverter`

#### convert

    @Nullable
    public Object convert(@Nullable
                                    Object source,
                                    TypeDescriptor sourceType,
                                    TypeDescriptor targetType)

Specified by:
  `convert` in interface `GenericConverter`

#### matches

    public boolean matches(TypeDescriptor sourceType,
                           TypeDescriptor targetType)

Specified by:
  `matches` in interface `ConditionalConverter`

#### setApplicationContext

    public void setApplicationContext(ApplicationContext context)

Specified by:
  `setApplicationContext` in interface `ApplicationContextAware`