Package org.jmolecules.spring
Class AssociationToPrimitivesConverter<T extends org.jmolecules.ddd.types.AggregateRoot<T,org.jmolecules.ddd.types.Identifier>>
java.lang.Object
org.jmolecules.spring.AssociationToPrimitivesConverter<T>
- All Implemented Interfaces:
org.springframework.core.convert.converter.GenericConverter
public class AssociationToPrimitivesConverter<T extends org.jmolecules.ddd.types.AggregateRoot<T,org.jmolecules.ddd.types.Identifier>>
extends Object
implements org.springframework.core.convert.converter.GenericConverter
Converts
Association instances into their backing Identifier or even to the wrapped value of those.- Author:
- Oliver Drotbohm
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverter
org.springframework.core.convert.converter.GenericConverter.ConvertiblePair -
Constructor Summary
ConstructorsConstructorDescriptionAssociationToPrimitivesConverter(Supplier<? extends org.springframework.core.convert.ConversionService> conversionService) Creates a newAssociationToPrimitivesConverterusing the givenConversionServicefor intermediate conversions.Creates a newAssociationToPrimitivesConverterusing the givenIdentifierToPrimitivesConverterfor intermediate conversions. -
Method Summary
-
Constructor Details
-
AssociationToPrimitivesConverter
public AssociationToPrimitivesConverter(Supplier<? extends org.springframework.core.convert.ConversionService> conversionService) Creates a newAssociationToPrimitivesConverterusing the givenConversionServicefor intermediate conversions.- Parameters:
conversionService- must not be null.
-
AssociationToPrimitivesConverter
Creates a newAssociationToPrimitivesConverterusing the givenIdentifierToPrimitivesConverterfor intermediate conversions.- Parameters:
delegate- must not be null.
-
-
Method Details
-
getConvertibleTypes
@NonNull public Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()- Specified by:
getConvertibleTypesin interfaceorg.springframework.core.convert.converter.GenericConverter
-
convert
@Nullable public Object convert(@Nullable Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
convertin interfaceorg.springframework.core.convert.converter.GenericConverter
-