org.springframework.batch.item.file.mapping

## 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>

      public class RecordFieldSetMapper<T>
      extends java.lang.Object
      implements 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

    Constructors
    Constructor and Description
    `RecordFieldSetMapper(java.lang.Class<T> targetType)` Create a new `RecordFieldSetMapper`.
    `RecordFieldSetMapper(java.lang.Class<T> targetType, org.springframework.core.convert.ConversionService conversionService)` Create a new `RecordFieldSetMapper`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `mapFieldSet(FieldSet fieldSet)` Method used to map data obtained from a `FieldSet` into an object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RecordFieldSetMapper

          public RecordFieldSetMapper(java.lang.Class<T> targetType)

      Create a new `RecordFieldSetMapper`.
      Parameters:
        `targetType` - type of mapped items

    - #### RecordFieldSetMapper

          public RecordFieldSetMapper(java.lang.Class<T> targetType,
                                      org.springframework.core.convert.ConversionService conversionService)

      Create a new `RecordFieldSetMapper`.
      Parameters:
        `targetType` - type of mapped items
        `conversionService` - service to use to convert raw data to typed fields

  - ### Method Detail

    - #### mapFieldSet

          public T mapFieldSet(FieldSet fieldSet)

      Description copied from interface: `FieldSetMapper`
      Method used to map data obtained from a `FieldSet` into an object.
      Specified by:
        `mapFieldSet` in interface `FieldSetMapper<T>`
      Parameters:
        `fieldSet` - the `FieldSet` to map
      Returns:
        the populated object