Class IntExtractor

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

public class IntExtractor extends SimpleFieldExtractor<Integer>
Extracts the field value and converts it to a int.

Returns an empty optional if the value failed to parse.

  • Constructor Details

    • IntExtractor

      public IntExtractor(String fieldName)
      Extracts a int value from the supplied field name. Writes the metadata out using the field name as the key.
      Parameters:
      fieldName - The field name to inspect.
    • IntExtractor

      public IntExtractor(String fieldName, String metadataName)
      Extracts a int value from the supplied field name. Writes the metadata out using the metadataName as the key.
      Parameters:
      fieldName - The field name to inspect.
      metadataName - The metadata name to emit.
  • Method Details

    • getValueType

      public Class<Integer> getValueType()
      Description copied from interface: FieldExtractor
      Gets the class of the value produced by this extractor.
      Returns:
      The class of the value.
    • extractField

      protected Optional<Integer> extractField(String value)
      Description copied from class: SimpleFieldExtractor
      Extracts the field value, or returns Optional.empty() if it failed to parse.
      Specified by:
      extractField in class SimpleFieldExtractor<Integer>
      Parameters:
      value - The field value to read.
      Returns:
      The extracted value.
    • getProvenance

      public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()