Class IndexedMapQuery<Value extends Storable>

java.lang.Object
com.codingchili.core.storage.AbstractQueryBuilder<Value>
com.codingchili.core.storage.IndexedMapQuery<Value>
Type Parameters:
Value - the value that is being queried.
All Implemented Interfaces:
QueryBuilder<Value>

public class IndexedMapQuery<Value extends Storable> extends AbstractQueryBuilder<Value>
Common query class used for disk persisted storage and in-memory indexed.
  • Constructor Details

  • Method Details

    • on

      public QueryBuilder<Value> on(String attribute)
      Description copied from interface: QueryBuilder
      The attribute to be queried.
      Specified by:
      on in interface QueryBuilder<Value extends Storable>
      Overrides:
      on in class AbstractQueryBuilder<Value extends Storable>
      Parameters:
      attribute - the name of the queried attribute.
      Returns:
      fluent
    • and

      public QueryBuilder<Value> and(String attribute)
      Description copied from interface: QueryBuilder
      Adds a new AND clause to the query.
      Parameters:
      attribute - the name of the attribute to be queried.
      Returns:
      fluent
    • or

      public QueryBuilder<Value> or(String attribute)
      Description copied from interface: QueryBuilder
      Adds a new OR clause to the query.
      Parameters:
      attribute - the name of the attribute to be queried.
      Returns:
      fluent
    • between

      public QueryBuilder<Value> between(Long minimum, Long maximum)
      Description copied from interface: QueryBuilder
      Matches documents with the attribute between and including minimum and maximum.
      Parameters:
      minimum - the minimum value to match
      maximum - the maximum value to match
      Returns:
      fluent
    • like

      public QueryBuilder<Value> like(String text)
      Description copied from interface: QueryBuilder
      Matches documents where the attribute containst the given text
      Parameters:
      text - the text to check if contained.
      Returns:
      fluent
    • startsWith

      public QueryBuilder<Value> startsWith(String text)
      Description copied from interface: QueryBuilder
      Matches if the specified attribute starts with the given text
      Parameters:
      text - the text to check if starting with.
      Returns:
      fluent
    • in

      public QueryBuilder<Value> in(Comparable... list)
      Description copied from interface: QueryBuilder
      Matches if a specified attribute is contained within the given list
      Parameters:
      list - the list that the attribute value must be contained in to match.
      Returns:
      fluent
    • equalTo

      public QueryBuilder<Value> equalTo(Comparable match)
      Description copied from interface: QueryBuilder
      Matches if the attribute is an exact match to the given text.
      Parameters:
      match - the text that should be equal to the specified attribute.
      Returns:
      fluent
    • matches

      public QueryBuilder<Value> matches(String regex)
      Description copied from interface: QueryBuilder
      Checks if the given attribute matches the given regex. Be careful when passing user input to this method. No complexity restrictions are applied. To pass user input use equals instead. If a query can use any non-regex constraint, it is recommended to use that instead.
      Parameters:
      regex - the regular expression in which the attribute is to match
      Returns:
      fluent
    • execute

      public void execute(io.vertx.core.Handler<io.vertx.core.AsyncResult<Collection<Value>>> handler)
      Description copied from interface: QueryBuilder
      Executes the constructed query asynchronously.
      Parameters:
      handler - the handler to be invoked when the result is completed.
    • setMapper

      public IndexedMapQuery<Value> setMapper(Function<Value,​Value> mapper)