public class OffsetDateTimeExtractor extends SimpleFieldExtractor<OffsetDateTime>
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.
fieldName, metadataName
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
protected Optional<OffsetDateTime> |
extractField(String s)
Extracts the field value, or returns
Optional.empty() if it failed to parse. |
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
Class<OffsetDateTime> |
getValueType()
Gets the class of the value produced by this extractor.
|
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
String |
toString() |
extract, getFieldName, getMetadataName
public OffsetDateTimeExtractor(String fieldName, String metadataName, String dateTimeFormat)
fieldName
- The field to read.metadataName
- The metadata field to write.dateTimeFormat
- The date/time format (supplied to DateTimeFormatter
.public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
in class SimpleFieldExtractor<OffsetDateTime>
public Class<OffsetDateTime> getValueType()
FieldExtractor
protected Optional<OffsetDateTime> extractField(String s)
SimpleFieldExtractor
Optional.empty()
if it failed to parse.extractField
in class SimpleFieldExtractor<OffsetDateTime>
s
- The field value to read.public String toString()
toString
in class SimpleFieldExtractor<OffsetDateTime>
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.