Class OffsetDateTimeExtractor

java.lang.Object
org.tribuo.data.columnar.extractors.SimpleFieldExtractor<OffsetDateTime>
org.tribuo.data.columnar.extractors.OffsetDateTimeExtractor
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<OffsetDateTime>

public class OffsetDateTimeExtractor extends SimpleFieldExtractor<OffsetDateTime>
Extracts the field value and translates it to an OffsetDateTime based on the specified DateTimeFormatter.

The formatter is supplied as a String to ensure it is tracked properly in the provenance.

Returns an empty optional if the date failed to parse.

  • Constructor Details

    • OffsetDateTimeExtractor

      public OffsetDateTimeExtractor(String fieldName, String metadataName, String dateTimeFormat)
      Constructs a date time extractor that emits an OffsetDateTime by applying the supplied format to the specified field.

      Uses the system locale for backwards compatibility with 4.0 and 4.1.

      Parameters:
      fieldName - The field to read.
      metadataName - The metadata field to write.
      dateTimeFormat - The date/time format (supplied to DateTimeFormatter.
    • OffsetDateTimeExtractor

      public OffsetDateTimeExtractor(String fieldName, String metadataName, String dateTimeFormat, String localeLanguage, String localeCountry)
      Constructs a date time extractor that emits an OffsetDateTime by applying the supplied format to the specified field.
      Parameters:
      fieldName - The field to read.
      metadataName - The metadata field to write to.
      dateTimeFormat - The date format (supplied to DateTimeFormatter.
      localeLanguage - The locale language.
      localeCountry - The locale country.
  • Method Details