java.lang.Object
com.iqser.red.service.redaction.v1.server.model.component.ComponentMapping
All Implemented Interfaces:
Queryable

public class ComponentMapping extends Object implements Queryable
  • Method Details

    • empty

      public static ComponentMapping empty(String name)
    • where

      public ComponentMapping.Query where(String query)
      Description copied from interface: Queryable
      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.

      Specified by:
      where in interface Queryable
      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.
    • existsByFirstColumn

      public boolean existsByFirstColumn(String query)
      Determines if the mapping contains at least one row, where the first column is equal to the provided query string.
      Parameters:
      query - String to search for
      Returns:
      true, if the mapping has at least one row, which has the query string as its first value.
    • getData

      public Stream<String[]> getData()
      Gets all data of this mapping.
      Specified by:
      getData in interface Queryable
      Returns:
      a list of string arrays representing the data of this component mapping
    • getMetaData

      public com.iqser.red.service.persistence.service.v1.api.shared.model.component.ComponentMappingMetadata getMetaData()
      Description copied from interface: Queryable
      Returns the metadata associated with this component mapping.
      Specified by:
      getMetaData in interface Queryable
      Returns:
      metadata of the component mapping
    • builder

      public static ComponentMapping.ComponentMappingBuilder<?,?> builder()