Class DateExtractor

java.lang.Object
org.tribuo.data.columnar.extractors.SimpleFieldExtractor<LocalDate>
org.tribuo.data.columnar.extractors.DateExtractor
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable, com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>, FieldExtractor<LocalDate>

public class DateExtractor extends SimpleFieldExtractor<LocalDate>
Extracts the field value and translates it to a LocalDate based on the specified DateTimeFormatter.

Returns an empty optional if the date failed to parse.

  • Constructor Details

    • DateExtractor

      public DateExtractor(String fieldName, String metadataName, String dateFormat)
      Constructs a date extractor that emits a LocalDate by applying the supplied format to the specified field.
      Parameters:
      fieldName - The field to read.
      metadataName - The metadata field to write.
      dateFormat - The date format (supplied to DateTimeFormatter.
    • DateExtractor

      @Deprecated public DateExtractor(String fieldName, String metadataName, DateTimeFormatter formatter)
      Deprecated.
      Constructs a date extractor that emits a LocalDate by applying the supplied format to the specified field.

      Deprecated as it does not allow recovery of the formatter pattern for the provenance.

      Parameters:
      fieldName - The field to read.
      metadataName - The metadata field to write.
      formatter - The date format (supplied to DateTimeFormatter.
  • Method Details