Lines Matching refs:Sets
24 import com.google.common.collect.Sets;
33 * Helper class for creating {@link CacheBuilder} instances with all combinations of several sets of
41 private Set<Integer> concurrencyLevels = Sets.newHashSet((Integer) null);
42 private Set<Integer> initialCapacities = Sets.newHashSet((Integer) null);
43 private Set<Integer> maximumSizes = Sets.newHashSet((Integer) null);
44 private Set<DurationSpec> expireAfterWrites = Sets.newHashSet((DurationSpec) null);
45 private Set<DurationSpec> expireAfterAccesses = Sets.newHashSet((DurationSpec) null);
46 private Set<DurationSpec> refreshes = Sets.newHashSet((DurationSpec) null);
47 private Set<Strength> keyStrengths = Sets.newHashSet((Strength) null);
48 private Set<Strength> valueStrengths = Sets.newHashSet((Strength) null);
51 this.concurrencyLevels = Sets.newLinkedHashSet(concurrencyLevels);
56 this.initialCapacities = Sets.newLinkedHashSet(initialCapacities);
61 this.maximumSizes = Sets.newLinkedHashSet(maximumSizes);
66 this.expireAfterWrites = Sets.newLinkedHashSet(durations);
71 this.expireAfterAccesses = Sets.newLinkedHashSet(durations);
76 this.refreshes = Sets.newLinkedHashSet(durations);
81 this.keyStrengths = Sets.newLinkedHashSet(keyStrengths);
87 this.valueStrengths = Sets.newLinkedHashSet(valueStrengths);
127 * Sets.cartesianProduct doesn't allow sets that contain null, but we want null to mean
129 * behavior. This method wraps the elements in the input sets (which may contain null) as
130 * Optionals, calls Sets.cartesianProduct with those, then transforms the result to unwrap
133 private Iterable<List<Object>> buildCartesianProduct(Set<?>... sets) {
134 List<Set<Optional<?>>> optionalSets = Lists.newArrayListWithExpectedSize(sets.length);
135 for (Set<?> set : sets) {
137 Sets.newLinkedHashSet(Iterables.transform(set, NULLABLE_TO_OPTIONAL));
140 Set<List<Optional<?>>> cartesianProduct = Sets.cartesianProduct(optionalSets);