@Test public void testCompleteHumanName() { String query = "human"; String node1 = "node1"; String node1HumanName = "humanName1"; String node2 = "node2"; CompletionMetadata metadata = CompletionMetadata.builder() .setNodes( ImmutableMap.of( node1, new NodeCompletionMetadata(node1HumanName), node2, new NodeCompletionMetadata(null))) .build(); assertThat( getTestPAC(query, metadata).run(), allOf( hasItem( new ParboiledAutoCompleteSuggestion(node1, null, 0, NODE_NAME, node1HumanName)))); }
Set<ParboiledAutoCompleteSuggestion> run() { Set<PotentialMatch> potentialMatches = getPotentialMatches(_query); return potentialMatches.stream() .map(this::autoCompletePotentialMatch) .flatMap(Collection::stream) .collect(ImmutableSet.toImmutableSet()); }
ParboiledAutoComplete { Set<ParboiledAutoCompleteSuggestion> run() { Set<PotentialMatch> potentialMatches = getPotentialMatches(_query); return potentialMatches.stream() .map(this::autoCompletePotentialMatch) .flatMap(Collection::stream) .collect(ImmutableSet.toImmutableSet()); } }
ParboiledAutoComplete { Set<ParboiledAutoCompleteSuggestion> run() { Set<PotentialMatch> potentialMatches = getPotentialMatches(_query); return potentialMatches.stream() .map(this::autoCompletePotentialMatch) .flatMap(Collection::stream) .collect(ImmutableSet.toImmutableSet()); } ParboiledAutoComplete(
      CommonParser parser,
      Grammar grammar,
      Map<String, Anchor.Type> completionTypes,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary);   ParboiledAutoComplete(
      Grammar grammar,
      Rule inputRule,
      Map<String, Anchor.Type> completionTypes,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary); }
ParboiledAutoComplete { Set<ParboiledAutoCompleteSuggestion> run() { Set<PotentialMatch> potentialMatches = getPotentialMatches(_query); return potentialMatches.stream() .map(this::autoCompletePotentialMatch) .flatMap(Collection::stream) .collect(ImmutableSet.toImmutableSet()); } ParboiledAutoComplete(
      CommonParser parser,
      Grammar grammar,
      Map<String, Anchor.Type> completionTypes,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary);   ParboiledAutoComplete(
      Grammar grammar,
      Rule inputRule,
      Map<String, Anchor.Type> completionTypes,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary); static List<AutocompleteSuggestion> autoComplete(
      Grammar grammar,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary); }
ParboiledAutoComplete { Set<ParboiledAutoCompleteSuggestion> run() { Set<PotentialMatch> potentialMatches = getPotentialMatches(_query); return potentialMatches.stream() .map(this::autoCompletePotentialMatch) .flatMap(Collection::stream) .collect(ImmutableSet.toImmutableSet()); } ParboiledAutoComplete(
      CommonParser parser,
      Grammar grammar,
      Map<String, Anchor.Type> completionTypes,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary);   ParboiledAutoComplete(
      Grammar grammar,
      Rule inputRule,
      Map<String, Anchor.Type> completionTypes,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary); static List<AutocompleteSuggestion> autoComplete(
      Grammar grammar,
      String network,
      String snapshot,
      String query,
      int maxSuggestions,
      CompletionMetadata completionMetadata,
      NodeRolesData nodeRolesData,
      ReferenceLibrary referenceLibrary);  }