Simple Extractor DSL.

Remarks

The methods in this class are for the most part simple factory methods for various ValueExtractor classes, but in some cases provide additional type safety. They also tend to make the code more readable, especially if imported statically, so their use is strongly encouraged in lieu of direct construction of ValueExtractor classes.

Hierarchy

  • Extractors

Constructors

Methods

  • Returns an extractor that extracts the specified fields or extractors where extraction occurs in a chain where the result of each field extraction is the input to the next extractor. The result returned is the result of the final extractor in the chain.

    Returns

    an extractor that extracts the value(s) of the specified field(s)

    Parameters

    • extractorsOrFields: string | ValueExtractor[]

      If extractorsOrFields is a string type, then the field names to extract (if any field name contains a dot '.' that field name is split into multiple field names delimiting on the dots. If extractorsOrFields is of ValueExtractor[] type, then the ValueExtractors are used to extract the values

    Returns ValueExtractor

  • Returns an extractor that extracts the value of the specified field.

    Returns

    an extractor that extracts the value of the specified field.

    Parameters

    • from: string

      the name of the field or method to extract the value from.

    • Optional params: any[]

      the parameters to pass to the method.

    Returns ValueExtractor

  • Returns an extractor that always returns its input argument.

    Returns

    an extractor that always returns its input argument

    Returns ValueExtractor

  • Returns an extractor that casts its input argument.

    Returns

    an extractor that always returns its input argument

    Returns ValueExtractor

  • Returns an extractor that extracts the specified fields and returns the extracted values in an array.

    Returns

    an extractor that extracts the value(s) of the specified field(s)

    Parameters

    • extractorOrFields: string | ValueExtractor[]

      the field names to extract

    Returns MultiExtractor