All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.api.common.query.QueryRequestBuilder Maven / Gradle / Ivy

The newest version!
package org.infinispan.api.common.query;

import java.util.HashMap;
import java.util.Map;

/**
 * Builder class to build {@link QueryRequest}
 * 

* Different parameters can be specified: * *

  • Ickle Query: Mandatory query string
  • *
  • Param: Parameters for the query/li> *
  • Skip: Skip this number of entries
  • *
  • Limit: Limit the result to this number of entries
  • *
    * * @since 14.0 */ public final class QueryRequestBuilder { private final Map params; private String ickleQuery; private long skip; private int limit = -1; private QueryRequestBuilder() { params = new HashMap<>(); } public static QueryRequestBuilder query(String ickleQuery) { QueryRequestBuilder queryParameters = new QueryRequestBuilder(); queryParameters.ickleQuery = ickleQuery; return queryParameters; } public QueryRequestBuilder param(String name, Object value) { params.put(name, value); return this; } public QueryRequestBuilder skip(long skip) { this.skip = skip; return this; } public QueryRequestBuilder limit(int limit) { this.limit = limit; return this; } public QueryRequest find() { return new QueryRequest(ickleQuery, params, skip, limit); } }




    © 2015 - 2024 Weber Informatics LLC | Privacy Policy