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:eu.interedition.collatex.neo4j.Neo4jVariantGraphEdge.java

@Override
public VariantGraph.Edge add(Set<Witness> witnesses) {
    graph.adapter.setWitnesses(this, Sets.union(witnesses(), witnesses));
    return this;
}

From source file:com.google.auto.factory.processor.FactoryMethodDescriptor.java

private FactoryMethodDescriptor(Builder builder) {
    this.declaration = builder.declaration;
    this.factoryName = builder.factoryName.get();
    this.name = builder.name.get();
    this.returnType = builder.returnType.get();
    this.publicMethod = builder.publicMethod;
    this.override = builder.override;
    this.passedParameters = ImmutableSet.copyOf(builder.passedParameters);
    this.providedParameters = ImmutableSet.copyOf(builder.providedParameters);
    this.creationParameters = ImmutableSet.copyOf(builder.creationParameters);
    checkState(creationParameters.equals(Sets.union(passedParameters, providedParameters)));
}

From source file:org.jboss.hal.client.runtime.subsystem.jaxrs.RestResource.java

Set<String> getProduces() {
    return Sets.union(mediaType(REST_RESOURCE_PATHS, PRODUCES), mediaType(SUB_RESOURCE_LOCATORS, PRODUCES))
            .immutableCopy();
}

From source file:io.mindmaps.graql.internal.query.ValuePredicateImpl.java

@Override
public ValuePredicate and(ValuePredicate other) {
    P<Object> and = predicate.and(other.admin().getPredicate());
    ImmutableSet<Object> innerUnion = ImmutableSet
            .copyOf(Sets.union(innerValues, other.admin().getInnerValues()));
    return new ValuePredicateImpl(and, "(" + repr + " and " + other.admin().toString() + ")", false,
            innerUnion);/*w ww . ja  v a2  s . c  o  m*/
}

From source file:org.apache.zeppelin.jdbc.DemonThread.java

private SqlCompleter createSqlCompleter(Connection jdbcConnection) {

    SqlCompleter completer = null;/*from  w  w  w . jav  a 2 s  .  c om*/
    try {
        Set<String> keywordsCompletions = SqlCompleter.getSqlKeywordsCompletions(jdbcConnection);
        Set<String> dataModelCompletions = SqlCompleter.getDataModelMetadataCompletions(jdbcConnection);
        SetView<String> allCompletions = Sets.union(keywordsCompletions, dataModelCompletions);
        completer = new SqlCompleter(allCompletions, dataModelCompletions);

    } catch (IOException | SQLException e) {
        logger.error("Cannot create SQL completer", e);
    }
    return completer;
}

From source file:seaclouds.utils.toscamodel.impl.CoercedType.java

@Override
public IType coerce(IConstraint constraint) {
    return new CoercedType(this.baseType, Sets.union(constraints, Collections.singleton(constraint)));
}

From source file:org.metaservice.core.dispatcher.NotifyPipe.java

@Override
public Optional<PostProcessorDispatcher.Context> process(PostProcessorDispatcher.Context context)
        throws PostProcessorException {
    Set<URI> resourcesThatChanged = Sets.union(context.subjects, context.objects);
    List<PostProcessingHistoryItem> oldHistory = context.task.getHistory();
    Date time = context.task.getTime();
    Set<URI> affectedProcessableSubjects = context.processableSubjects;
    notifyPostProcessors(resourcesThatChanged, oldHistory, time, postProcessorDescriptor,
            affectedProcessableSubjects);
    return Optional.of(context);
}

From source file:com.hortonworks.streamline.streams.layout.component.TopologyDag.java

public Set<Component> getComponents() {
    return Sets.union(inputComponents, outputComponents);
}

From source file:org.mitre.openid.connect.client.service.impl.HybridIssuerService.java

public Set<String> getBlacklist() {
    return Sets.union(thirdPartyIssuerService.getBlacklist(), webfingerIssuerService.getWhitelist());
}

From source file:org.sosy_lab.cpachecker.cpa.invariants.InvariantsMergeOperator.java

@Override
public AbstractState merge(AbstractState pState1, AbstractState pState2, Precision pPrecision)
        throws CPAException, InterruptedException {
    InvariantsState state1 = (InvariantsState) pState1;
    InvariantsState state2 = (InvariantsState) pState2;
    InvariantsPrecision precision = (InvariantsPrecision) pPrecision;
    boolean isMergeAllowed = isMergeAllowed(state1, state2, precision);
    AbstractionState abstractionState1 = state1.determineAbstractionState(precision);
    AbstractionState abstractionState2 = state2.determineAbstractionState(precision);
    Set<String> wideningTargets = abstractionState1.determineWideningTargets(abstractionState2);
    Set<InvariantsFormula<CompoundInterval>> wideningHints = Sets.union(abstractionState1.getWideningHints(),
            abstractionState2.getWideningHints());
    state1 = state1.widen(state2, precision, wideningTargets, wideningHints);
    if (state1 != pState1
            && definitelyImplies(state2, reduceToGivenVariables(reduceToInterestingVariables(state1, precision),
                    Sets.difference(state1.getEnvironment().keySet(), wideningTargets)))) {
        isMergeAllowed = true;//from   w  ww .  j  av  a  2s  .c  om
    }
    InvariantsState result = state2;
    if (isMergeAllowed) {
        result = state1.join(state2, precision);
    }
    return result;
}