Package org.jmolecules.spring
Class PrimitivesToAssociationConverter<T extends org.jmolecules.ddd.types.AggregateRoot<T,org.jmolecules.ddd.types.Identifier>>
java.lang.Object
org.jmolecules.spring.PrimitivesToAssociationConverter<T>
- All Implemented Interfaces:
org.springframework.core.convert.converter.GenericConverter
public class PrimitivesToAssociationConverter<T extends org.jmolecules.ddd.types.AggregateRoot<T,org.jmolecules.ddd.types.Identifier>>
extends Object
implements org.springframework.core.convert.converter.GenericConverter
Converter to create
Association instances from either Identifier primitives or Identifier
instances themselves.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.core.convert.converter.GenericConverter
org.springframework.core.convert.converter.GenericConverter.ConvertiblePair -
Constructor Summary
ConstructorsConstructorDescriptionPrimitivesToAssociationConverter(Supplier<? extends org.springframework.core.convert.ConversionService> conversionService) Creates a newPrimitivesToAssociationConverterusing the givenConversionServicefor intermediate conversions.Creates a newPrimitivesToAssociationConverterusing the given delegatePrimitivesToIdentifierConverterfor intermediate conversions. -
Method Summary
Modifier and TypeMethodDescriptionorg.jmolecules.ddd.types.Association<?,?> convert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair>
-
Constructor Details
-
PrimitivesToAssociationConverter
public PrimitivesToAssociationConverter(Supplier<? extends org.springframework.core.convert.ConversionService> conversionService) Creates a newPrimitivesToAssociationConverterusing the givenConversionServicefor intermediate conversions.- Parameters:
conversionService- must not be null.
-
PrimitivesToAssociationConverter
Creates a newPrimitivesToAssociationConverterusing the given delegatePrimitivesToIdentifierConverterfor 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 org.jmolecules.ddd.types.Association<?,?> convert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
convertin interfaceorg.springframework.core.convert.converter.GenericConverter
-