Package org.jmolecules.spring
Class IdentifierToPrimitivesConverter
java.lang.Object
org.jmolecules.spring.IdentifierToPrimitivesConverter
- All Implemented Interfaces:
org.springframework.core.convert.converter.ConditionalConverter,org.springframework.core.convert.converter.ConditionalGenericConverter,org.springframework.core.convert.converter.GenericConverter
public class IdentifierToPrimitivesConverter
extends Object
implements org.springframework.core.convert.converter.ConditionalGenericConverter
A Spring
Converter to convert from jMolecules Identifier types to primitives like UUID and
String assuming the Identifier implementation contains a single property of that type.- 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
ConstructorsConstructorDescriptionIdentifierToPrimitivesConverter(Supplier<? extends org.springframework.core.convert.ConversionService> conversionService) -
Method Summary
Modifier 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)
-
Constructor Details
-
IdentifierToPrimitivesConverter
public IdentifierToPrimitivesConverter(Supplier<? extends org.springframework.core.convert.ConversionService> conversionService)
-
-
Method Details
-
getConvertibleTypes
@NonNull public Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()- Specified by:
getConvertibleTypesin interfaceorg.springframework.core.convert.converter.GenericConverter
-
matches
public boolean matches(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - Specified by:
matchesin interfaceorg.springframework.core.convert.converter.ConditionalConverter
-
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
-