private static void createSymlinks(Path path, Collection<ExternalDependency> dependencies) { if (!path.toFile().exists() && !path.toFile().mkdirs()) { throw new RuntimeException(String.format("Couldn't create %s when creating symlinks", path)); } SetMultimap<VersionlessDependency, ExternalDependency> nameToDependencyMap = MultimapBuilder.hashKeys().hashSetValues().build(); dependencies.forEach( dependency -> nameToDependencyMap.put(dependency.getVersionless(), dependency)); dependencies.forEach( dependency -> { FileUtil.symlink( path.resolve(dependency.getDependencyFileName()), dependency.getRealDependencyFile().toPath()); dependency .getRealSourceFile() .ifPresent( file -> FileUtil.symlink( path.resolve(dependency.getSourceFileName()), file.toPath())); }); } }
@Override protected WebTarget getBaseResource() { return new OkHttpWebTarget( okHttpClient, baseUrl, ImmutableList.of(), MultimapBuilder.hashKeys().hashSetValues().build() ); }
@GwtIncompatible // serialization public void testSerialization() throws Exception { for (MultimapBuilderWithKeys<?> builderWithKeys : ImmutableList.of( MultimapBuilder.hashKeys(), MultimapBuilder.linkedHashKeys(), MultimapBuilder.treeKeys(), MultimapBuilder.enumKeys(RoundingMode.class))) { for (MultimapBuilder<?, ?> builder : ImmutableList.of( builderWithKeys.arrayListValues(), builderWithKeys.linkedListValues(), builderWithKeys.hashSetValues(), builderWithKeys.linkedHashSetValues(), builderWithKeys.treeSetValues(), builderWithKeys.enumSetValues(RoundingMode.class))) { /* * Temporarily inlining SerializableTester here for obscure internal reasons. */ reserializeAndAssert(builder.build()); } } }
public SampleGraph(final Method m, final SampleNode node) { int nrNodes = node.getNrNodes(); vertexMap = MultimapBuilder.hashKeys(nrNodes).hashSetValues(1).build(); aggregates = new THashMap<>(nrNodes); sampleTree = GraphBuilder.directed() .nodeOrder(ElementOrder.unordered()) .allowsSelfLoops(false) .expectedNodeCount(nrNodes) .build(); aggGraph = GraphBuilder.directed() .nodeOrder(ElementOrder.unordered()) .allowsSelfLoops(false) .expectedNodeCount(nrNodes) .build(); rootVertex = tree2Graph(m, node); }
@GwtIncompatible // serialization public void testSerialization() throws Exception { for (MultimapBuilderWithKeys<?> builderWithKeys : ImmutableList.of( MultimapBuilder.hashKeys(), MultimapBuilder.linkedHashKeys(), MultimapBuilder.treeKeys(), MultimapBuilder.enumKeys(RoundingMode.class))) { for (MultimapBuilder<?, ?> builder : ImmutableList.of( builderWithKeys.arrayListValues(), builderWithKeys.linkedListValues(), builderWithKeys.hashSetValues(), builderWithKeys.linkedHashSetValues(), builderWithKeys.treeSetValues(), builderWithKeys.enumSetValues(RoundingMode.class))) { /* * Temporarily inlining SerializableTester here for obscure internal reasons. */ reserializeAndAssert(builder.build()); } } }
public CandidateProvider() { candidatesMap = MultimapBuilder.hashKeys().hashSetValues().build(); }
/** Uses a hash-based {@code Set} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
public Builder() { this.flags = MultimapBuilder.hashKeys().hashSetValues().build(); }
/** Uses a hash-based {@code Set} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
/** * Uses a {@link HashSet} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
public void testGenerics_gwtCompatible() { ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().<String, Integer>build(); SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().<String, Integer>build(); SetMultimap<String, Integer> c = MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER) .hashSetValues().<String, Integer>build(); }
@GwtIncompatible // doesn't build without explicit type parameters on build() methods public void testGenerics() { ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build(); SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build(); SetMultimap<String, Integer> c = MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build(); }
/** * Copy constructor. * * @param other The constructed object is a replicated copy of this element. */ public ReachingUses(ReachingUses other) { mayUseMap = MultimapBuilder.hashKeys().hashSetValues().build(other.mayUseMap); }
/** * Uses a {@link HashSet} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
/** * Uses a {@link HashSet} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
/** Uses a hash-based {@code Set} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
/** Uses a hash-based {@code Set} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
/** Uses a hash-based {@code Set} to store value collections. */ public SetMultimapBuilder<K0, Object> hashSetValues() { return hashSetValues(DEFAULT_EXPECTED_VALUES_PER_KEY); }
public void testGenerics_gwtCompatible() { ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().<String, Integer>build(); SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().<String, Integer>build(); SetMultimap<String, Integer> c = MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER) .hashSetValues() .<String, Integer>build(); }
@GwtIncompatible // doesn't build without explicit type parameters on build() methods public void testGenerics() { ListMultimap<String, Integer> a = MultimapBuilder.hashKeys().arrayListValues().build(); SortedSetMultimap<String, Integer> b = MultimapBuilder.linkedHashKeys().treeSetValues().build(); SetMultimap<String, Integer> c = MultimapBuilder.treeKeys(String.CASE_INSENSITIVE_ORDER).hashSetValues().build(); }