Class RecordFieldSetMapper<T>
java.lang.Object
org.springframework.batch.item.file.mapping.RecordFieldSetMapper<T>
- Type Parameters:
T
- type of mapped items
- All Implemented Interfaces:
FieldSetMapper<T>
This is a
FieldSetMapper
that supports Java records mapping (requires JKD 14 or
higher). It uses the record's canonical constructor to map components with the same
name as tokens in the FieldSet
.- Since:
- 4.3
- Author:
- Mahmoud Ben Hassine
-
Constructor Summary
ConstructorDescriptionRecordFieldSetMapper
(Class<T> targetType) Create a newRecordFieldSetMapper
.RecordFieldSetMapper
(Class<T> targetType, org.springframework.core.convert.ConversionService conversionService) Create a newRecordFieldSetMapper
. -
Method Summary
Modifier and TypeMethodDescriptionmapFieldSet
(FieldSet fieldSet) Method used to map data obtained from aFieldSet
into an object.
-
Constructor Details
-
RecordFieldSetMapper
Create a newRecordFieldSetMapper
.- Parameters:
targetType
- type of mapped items
-
RecordFieldSetMapper
public RecordFieldSetMapper(Class<T> targetType, org.springframework.core.convert.ConversionService conversionService) Create a newRecordFieldSetMapper
.- Parameters:
targetType
- type of mapped itemsconversionService
- service to use to convert raw data to typed fields
-
-
Method Details
-
mapFieldSet
Description copied from interface:FieldSetMapper
Method used to map data obtained from aFieldSet
into an object.- Specified by:
mapFieldSet
in interfaceFieldSetMapper<T>
- Parameters:
fieldSet
- theFieldSet
to map- Returns:
- the populated object
-