Example usage for com.google.common.collect Sets union

List of usage examples for com.google.common.collect Sets union

Introduction

In this page you can find the example usage for com.google.common.collect Sets union.

Prototype

public static <E> SetView<E> union(final Set<? extends E> set1, final Set<? extends E> set2) 

Source Link

Document

Returns an unmodifiable view of the union of two sets.

Usage

From source file:com.stackframe.base.Numbers.java

private static Set<Number> positiveIntegers() {
    // Consider adding BigInteger and other subclasses of Number that are integers.
    Set<? extends Number> longKeys = ContiguousSet.create(Range.greaterThan(0L), DiscreteDomain.longs());
    Set<? extends Number> intKeys = ContiguousSet.create(Range.greaterThan(0), DiscreteDomain.integers());
    return Sets.union(longKeys, intKeys);
}

From source file:com.facebook.buck.versions.VersionedTargetGraphAndTargets.java

public static TargetGraphAndTargets toVersionedTargetGraphAndTargets(
        TargetGraphAndTargets targetGraphAndTargets,
        InstrumentedVersionedTargetGraphCache versionedTargetGraphCache, BuckEventBus buckEventBus,
        BuckConfig buckConfig, TypeCoercerFactory typeCoercerFactory,
        UnconfiguredBuildTargetFactory unconfiguredBuildTargetFactory,
        ImmutableSet<BuildTarget> explicitTestTargets) throws VersionException, InterruptedException {
    TargetGraphAndBuildTargets targetGraphAndBuildTargets = TargetGraphAndBuildTargets
            .of(targetGraphAndTargets.getTargetGraph(),
                    Sets.union(targetGraphAndTargets.getProjectRoots().stream()
                            .map(root -> root.getBuildTarget()).collect(Collectors.toSet()),
                            explicitTestTargets));
    TargetGraphAndBuildTargets versionedTargetGraphAndBuildTargets = versionedTargetGraphCache
            .toVersionedTargetGraph(buckEventBus, buckConfig, typeCoercerFactory,
                    unconfiguredBuildTargetFactory, targetGraphAndBuildTargets);
    return new TargetGraphAndTargets(versionedTargetGraphAndBuildTargets.getTargetGraph(),
            targetGraphAndTargets.getProjectRoots());
}

From source file:com.google.gerrit.server.index.IndexUtils.java

public static Set<String> accountFields(QueryOptions opts) {
    Set<String> fs = opts.fields();
    return fs.contains(AccountField.ID.getName()) ? fs
            : Sets.union(fs, ImmutableSet.of(AccountField.ID.getName()));
}

From source file:com.opengamma.strata.report.framework.expression.TradeTokenEvaluator.java

@Override
public Set<String> tokens(Trade trade) {
    MetaBean metaBean = JodaBeanUtils.metaBean(trade.getClass());
    return Sets.union(metaBean.metaPropertyMap().keySet(), trade.getInfo().propertyNames());
}

From source file:com.opengamma.strata.report.framework.expression.PositionTokenEvaluator.java

@Override
public Set<String> tokens(Position position) {
    MetaBean metaBean = JodaBeanUtils.metaBean(position.getClass());
    return Sets.union(metaBean.metaPropertyMap().keySet(), position.getInfo().propertyNames());
}

From source file:com.github.benmanes.caffeine.cache.local.AddFastPath.java

@Override
protected boolean applies() {
    boolean parentFastPath = Feature.usesFastPath(context.parentFeatures);
    boolean fastpath = Feature.usesFastPath(Sets.union(context.parentFeatures, context.generateFeatures));
    return (parentFastPath != fastpath);
}

From source file:shaded.org.openqa.selenium.remote.server.handler.GetAvailableLogTypesHandler.java

@Override
public Set<String> call() throws Exception {
    return Sets.union(getDriver().manage().logs().getAvailableLogTypes(), ImmutableSet.of(LogType.SERVER));
}

From source file:org.gradle.api.internal.project.DefaultProjectTaskLister.java

public Collection<Task> listProjectTasks(Project project) {
    ProjectInternal projectInternal = (ProjectInternal) project;
    TaskContainerInternal tasks = projectInternal.getTasks();
    tasks.actualize();/*from  w ww .j av  a 2 s.c o m*/
    return Sets.union(tasks, projectInternal.getImplicitTasks());
}

From source file:storm.benchmark.lib.reducer.SetReducer.java

@Override
public Set<T> reduce(Set<T> v1, Set<T> v2) {
    return Sets.union(v1, v2);
}

From source file:com.opengamma.strata.report.framework.expression.SecurityTokenEvaluator.java

@Override
public Set<String> tokens(Security security) {
    MetaBean metaBean = JodaBeanUtils.metaBean(security.getClass());
    return Sets.union(Sets.union(metaBean.metaPropertyMap().keySet(), security.getInfo().propertyNames()),
            security.getInfo().getPriceInfo().propertyNames());
}