Class RecordFieldExtractor<T>

java.lang.Object
org.springframework.batch.item.file.transform.RecordFieldExtractor<T>
All Implemented Interfaces:
FieldExtractor<T>

public class RecordFieldExtractor<T> extends Object implements FieldExtractor<T>
This is a field extractor for a Java record. By default, it will extract all record components, unless a subset is selected using setNames(String...).
Since:
5.0
Author:
Mahmoud Ben Hassine
  • Constructor Details

    • RecordFieldExtractor

      public RecordFieldExtractor(Class<? extends T> targetType)
  • Method Details

    • setNames

      public void setNames(String... names)
      Set the names of record components to extract.
      Parameters:
      names - of record component to be extracted.
    • extract

      public Object[] extract(T item)
      Specified by:
      extract in interface FieldExtractor<T>
      Parameters:
      item - the object that contains the information to be extracted.
      Returns:
      an array containing item's parts
      See Also: