Package com.proverby.api

Examples of com.proverby.api.Query


  }

  public void testFilterProverbs()
  {
    api.attachProverbListener(detailListener);
    Query query = Query.createSearchProverbQuery()
        .addParameter(CriteriaParameter.create("leader"));
    query.addParameter(SortParameter.create(SortOrder.NAME_DESCENDING));
    api.listProverbs(query);
  }
View Full Code Here


  }

  public void testListProverbsByCountry()
  {
    api.attachProverbListener(l);
    Query query = Query.createListProverbByCountryQuery();
    query.addParameter( CountryParameter.create("Trinidad and Tobago")) ;
    api.listProverbs(query);
  }
View Full Code Here

  }
 
  public void testListProverbsByRegion()
  {
    api.attachProverbListener(l);
    Query query = Query.createListProverbByCountryQuery();
    query.addParameter( RegionParameter.create("africa")) ;
    api.listProverbs(query);
  }
View Full Code Here

  }
 
  public void testListProverbsByTag()
  {
    api.attachProverbListener(l);
    Query query = Query.createListProverbByCountryQuery();
    query.addParameter( TagParameter.create("god")) ;
    api.listProverbs(query);
  }
View Full Code Here

  public void testSearchProverbs()
  {
    api.attachProverbListener(detailListener);

    Query query = Query.createSearchProverbQuery();
    query.addParameter(CriteriaParameter.create("leader"));
    query.addParameter(PageParameter.create(1));
    query.addParameter(new MaxResultsParameter(25));
    api.listProverbs(query);

    query = Query.createSearchProverbQuery();
    query.addParameter(CriteriaParameter.create("leader"));
    query.addParameter(PageParameter.create(2));
    query.addParameter(new MaxResultsParameter(25));
    api.listProverbs(query);

    query = Query.createSearchProverbQuery();
    query.addParameter(CriteriaParameter.create("leader"));
    query.addParameter(PageParameter.create(3));
    query.addParameter(new MaxResultsParameter(25));
    api.listProverbs(query);

    query = Query.createSearchProverbQuery();
    query.addParameter(CriteriaParameter.create("leader"));
    query.addParameter(PageParameter.create(4));
    query.addParameter(new MaxResultsParameter(25));
    api.listProverbs(query);
  }
View Full Code Here

  }

  public void listTags()
  {
    ParseStatus status = ParseStatus.LOADING;
    Query query = Query.createTagListQuery();
    Iterator<EarthProverbsListener> iterator = tagListeners.iterator();
    while (iterator.hasNext())
    {
      iterator.next().loading();
    }
    ObjectMapper mapper = new ObjectMapper();

    try
    {
      URL url = query.getURL();
      lock.lock();
      tags = mapper.readValue(url, new TypeReference<List<String>>() {
      });
      status = ParseStatus.SUCCESS;
    }
View Full Code Here

  }

  public void listRegions()
  {
    ParseStatus status = ParseStatus.LOADING;
    Query query = Query.createRegionListQuery();
    Iterator<EarthProverbsListener> iterator = regionListeners.iterator();
    while (iterator.hasNext())
    {
      iterator.next().loading();
    }
    ObjectMapper mapper = new ObjectMapper();

    try
    {
      URL url = query.getURL();
      lock.lock();
      regions = mapper.readValue(url, new TypeReference<List<String>>() {
      });
      status = ParseStatus.SUCCESS;
    }
View Full Code Here

TOP

Related Classes of com.proverby.api.Query

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.