Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.factual.driver;
  
  import java.util.Iterator;
  import java.util.Map;
  import java.util.HashMap;
  
 
 public class MultiRequest {
 
   private final Map<StringRequestImplqueries = new HashMap<StringRequestImpl>();

  
Add a raw read request for inclusion in the next multi request.

Parameters:
queryName the name for this subquery within the multi request
path the path to run the request against
params the parameters to send with the request
 
   public void addQuery(String queryNameString pathMap<StringObjectparams) {
     .put(queryNamenew RawReadRequest(pathparams));
   }

  
Add a read request for inclusion in the next multi request.

Parameters:
queryName the name for this subquery within the multi request
table the name of the table you wish to query (e.g., "places")
query the read query to run against table.
 
   public void addQuery(String queryNameString tableQuery query) {
     .put(queryNamenew ReadRequest(Factual.urlForFetch(table), query.toUrlParams()));
   }

  
Add a resolve request for inclusion in the next multi request.

Parameters:
queryName the name for this subquery within the multi request
table the name of the table you wish to use resolve against (e.g., "places")
query the resolve query to run against table.
 
   public void addQuery(String queryNameString tableResolveQuery query) {
     .put(queryNamenew ResolveRequest(Factual.urlForResolve(table), query.toUrlParams()));
   }

  
Add a facet request for inclusion in the next multi request.

Parameters:
queryName the name for this subquery within the multi request
table the name of the table you wish to use a facet request against (e.g., "places")
query the facet query to run against table.
 
   public void addQuery(String queryNameString tableFacetQuery query) {
     .put(queryNamenew FacetRequest(Factual.urlForFacets(table), query.toUrlParams()));
   }

  
Add a geocode request for inclusion in the next multi request.

Parameters:
queryName the name for this subquery within the multi request
query the geocode query to run
 
   public void addQuery(String queryNameGeocode query) {
     .put(queryNamenew ReadRequest(Factual.urlForGeocode(), query.toUrlParams()));
   }

  
Add a geopulse request for inclusion in the next multi request.

Parameters:
queryName the name for this subquery within the multi request
query the geopulse query to run
 
   public void addQuery(String queryNameGeopulse query) {
     .put(queryNamenew ReadRequest(Factual.urlForGeopulse(), query.toUrlParams()));
   }
  
  
Remove a query from the next multi request.

Parameters:
queryName the name for the subquery to remove from the multi request
  public void removeQuery(String queryName) {
    .remove(queryName);
  }
  
  /*
  public Iterator<Entry<String, String>> iterator() {
     Map<String, String> nameURLMap = new HashMap<String, String>();
     for(Entry<String, RequestImpl> entry : queries.entrySet()) {
       nameURLMap.put(entry.getKey(), entry.getValue().toUrlString());
     }
     return nameURLMap.entrySet().iterator();
  }
  */
  
  protected Map<StringRequestImplgetQueries() {
    return ;
  }
New to GrepCode? Check out our FAQ X