All Known Implementing Classes:
ComponentMapping, ComponentMapping.Query

public interface Queryable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.commons.codec.language.Soundex
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the already filtered data of this queryable object.
    com.iqser.red.service.persistence.service.v1.api.shared.model.component.ComponentMappingMetadata
    Returns the metadata associated with this component mapping.
    where(String query)
    Queries the data using the provided query.
  • Field Details

    • soundex

      static final org.apache.commons.codec.language.Soundex soundex
  • Method Details

    • getData

      Stream<String[]> getData()
      Returns the already filtered data of this queryable object.
      Returns:
      the queried data as a stream
    • getMetaData

      com.iqser.red.service.persistence.service.v1.api.shared.model.component.ComponentMappingMetadata getMetaData()
      Returns the metadata associated with this component mapping.
      Returns:
      metadata of the component mapping
    • where

      default ComponentMapping.Query where(String query)
      Queries the data using the provided query.

      A simple query string might look something like this:

      number = 10

      "number" must match one of the column labels exactly, "=" describes the operator, and "10" the value.

      Other operators include:

      - =, equals

      - contains

      - matches

      - soundslike

      For more details, see: QueryOperator.

      It's also important to note all strings containing whitespaces must be escaped using the char ' as such:

      name contains 'John Doe'

      If the query is supposed to contain the character ', the character must be escaped using \. e.g.

      name = Peter\\'s

      The escape character \ needs to be escaped itself due to java's string handling.

      When performance is of concern due to very large component mapping files, the first query should use the EQUALS operator and be performed on the first column of the CSV.

      Then a binary search will be performed, significantly speeding up the first lookup.

      Parameters:
      query - a String describing the query to be performed on the data of this queryable object.
      Returns:
      a Query containing the queries data as a Stream of String arrays.