Examples of SearchMetadata


Examples of com.linkedin.restli.examples.greetings.api.SearchMetadata

  {
    Request<CollectionResponse<Greeting>> req = builders.findBy("SearchWithFacets").setQueryParam("tone", Tone.SINCERE).build();
    ResponseFuture<CollectionResponse<Greeting>> future = client.sendRequest(req);
    Response<CollectionResponse<Greeting>> response = future.getResponse();
    checkHeaderForCompression(response, operationsForCompression, "finder:" + req.getMethodName());
    SearchMetadata metadata = new SearchMetadata(response.getEntity().getMetadataRaw());
    Assert.assertTrue(metadata.getFacets().size() > 0);
    // "randomly" generated data is guaranteed to have positive number of each tone
  }
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.SearchMetadata

  public void testSearchFacets(RootBuilderWrapper<Long, Greeting> builders) throws RemoteInvocationException
  {
    Request<CollectionResponse<Greeting>> req = builders.findBy("SearchWithFacets").setQueryParam("tone", Tone.SINCERE).build();
    ResponseFuture<CollectionResponse<Greeting>> future = REST_CLIENT.sendRequest(req);
    Response<CollectionResponse<Greeting>> response = future.getResponse();
    SearchMetadata metadata = new SearchMetadata(response.getEntity().getMetadataRaw());
    Assert.assertTrue(metadata.getFacets().size() > 0);
    // "randomly" generated data is guaranteed to have positive number of each tone
  }
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.SearchMetadata

            new GreetingsBuilders().options(),
            new NamedDataSchema[]
              {
                new Greeting().schema(),
                new TransferOwnershipRequest().schema(),
                new SearchMetadata().schema(),
                new Empty().schema(),
                (NamedDataSchema)DataTemplateUtil.getSchema(Tone.class)
              }
          },
        new Object[]
          {
            new GreetingsRequestBuilders().options(),
            new NamedDataSchema[]
              {
                new Greeting().schema(),
                new TransferOwnershipRequest().schema(),
                new SearchMetadata().schema(),
                new Empty().schema(),
                (NamedDataSchema)DataTemplateUtil.getSchema(Tone.class)
              }
          },
        new Object[]
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.SearchMetadata

        toneCounts.put(g.getTone(), 0);
      }
      toneCounts.put(g.getTone(), toneCounts.get(g.getTone()) + 1);
    }

    SearchMetadata metadata = new SearchMetadata();
    metadata.setFacets(new ToneFacetArray());
    for(Map.Entry<Tone, Integer> entry : toneCounts.entrySet())
    {
      ToneFacet f = new ToneFacet();
      f.setTone(entry.getKey());
      f.setCount(entry.getValue());
      metadata.getFacets().add(f);
    }

    return new CollectionResult<Greeting, SearchMetadata>(greetings, null, metadata);
  }
View Full Code Here

Examples of com.linkedin.restli.examples.greetings.api.SearchMetadata

  @Finder("searchWithMetadata")
  public CollectionResult<Greeting, SearchMetadata> searchWithMetadata()
  {
    return new CollectionResult<Greeting, SearchMetadata>(Collections.<Greeting>emptyList(),
                                                          0,
                                                          new SearchMetadata());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.