@Test public void testNodeRoleNameAutocomplete() { String network = "network"; NodeRolesData nodeRolesData = NodeRolesData.builder() .setRoleDimensions( ImmutableList.of( NodeRoleDimension.builder() .setName("someDimension") .setRoleDimensionMappings( ImmutableList.of( new RoleDimensionMapping( "(.*)", null, ImmutableMap.of("node1", "r1", "node2", "s1")))) .build(), NodeRoleDimension.builder() .setName("someOtherDimension") .setRoleDimensionMappings( ImmutableList.of( new RoleDimensionMapping( "(.*)", null, ImmutableMap.of("node3", "r2")))) .build())) .build(); assertThat( AutoCompleteUtils.autoComplete( network, "snapshot", Type.NODE_ROLE_NAME, "r", 5, CompletionMetadata.builder() .setNodes(ImmutableSet.of("node1", "node2", "node3")) .build(), nodeRolesData, null) .stream() .map(AutocompleteSuggestion::getText) .collect(Collectors.toSet()), equalTo(ImmutableSet.of("r1", "r2"))); }
@Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); } }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }  }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }  @Nonnull static List<AutocompleteSuggestion> autoComplete(
      Variable.Type completionType, String query, int maxSuggestions); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary,
      boolean fuzzyMatching); @Nonnull static List<AutocompleteSuggestion> baseAutoComplete(
      @Nullable String query, Set<String> allProperties); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Set<String> strings); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Map<String, Optional<String>> stringsWithDescriptions); @Nonnull static ImmutableList<AutocompleteSuggestion> ipStringAutoComplete(
      @Nullable String query, Map<Ip, IpCompletionMetadata> ips); }
AutoCompleteUtils { @Nonnull public static List<AutocompleteSuggestion> autoComplete( Variable.Type completionType, String query, int maxSuggestions) { return autoComplete(null, null, completionType, query, maxSuggestions, null, null, null); }  @Nonnull static List<AutocompleteSuggestion> autoComplete(
      Variable.Type completionType, String query, int maxSuggestions); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary); @Nonnull static List<AutocompleteSuggestion> autoComplete(
      @Nullable String network,
      @Nullable String snapshot,
      Variable.Type completionType,
      String query,
      int maxSuggestions,
      @Nullable CompletionMetadata completionMetadata,
      @Nullable NodeRolesData nodeRolesData,
      @Nullable ReferenceLibrary referenceLibrary,
      boolean fuzzyMatching); @Nonnull static List<AutocompleteSuggestion> baseAutoComplete(
      @Nullable String query, Set<String> allProperties); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Set<String> strings); @Nonnull static List<AutocompleteSuggestion> stringAutoComplete(
      @Nullable String query, Map<String, Optional<String>> stringsWithDescriptions); @Nonnull static ImmutableList<AutocompleteSuggestion> ipStringAutoComplete(
      @Nullable String query, Map<Ip, IpCompletionMetadata> ips);  }