Class ServiceBasedEntityConverter<O extends Identifiable>
java.lang.Object
ubic.gemma.persistence.util.ServiceBasedEntityConverter<O>
- Type Parameters:
- O- the type of entity this converter produces
- All Implemented Interfaces:
- org.springframework.core.convert.converter.ConditionalConverter, org.springframework.core.convert.converter.ConditionalGenericConverter, org.springframework.core.convert.converter.GenericConverter
- Direct Known Subclasses:
- ServiceBasedValueObjectConverter
public class ServiceBasedEntityConverter<O extends Identifiable>
extends Object
implements org.springframework.core.convert.converter.ConditionalGenericConverter
Performs conversion by identifier and collection of identifier for a 
BaseReadOnlyService.
The converter recognize two cases: Long → O and Collection of Long to List
of O using BaseReadOnlyService.load(Long) and BaseReadOnlyService.load(Collection) respectively.
The conversion also works with supertypes of O up to Identifiable.
- Author:
- poirigui
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverterorg.springframework.core.convert.converter.GenericConverter.ConvertiblePair
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> 
- 
Constructor SummaryConstructorsConstructorDescriptionServiceBasedEntityConverter(BaseReadOnlyService<? extends O> service, Class<O> entityType) 
- 
Method SummaryModifier and TypeMethodDescriptionconvert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> booleanmatches(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) 
- 
Field Details- 
convertibleTypesprotected final Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> convertibleTypes
 
- 
- 
Constructor Details- 
ServiceBasedEntityConverter
 
- 
- 
Method Details- 
matchespublic boolean matches(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
- matchesin interface- org.springframework.core.convert.converter.ConditionalConverter
 
- 
getConvertibleTypespublic Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()- Specified by:
- getConvertibleTypesin interface- org.springframework.core.convert.converter.GenericConverter
 
- 
convert
 
-