Example usage for com.google.common.collect ImmutableSet copyOf

List of usage examples for com.google.common.collect ImmutableSet copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSet copyOf.

Prototype

public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) 

Source Link

Usage

From source file:pt.ua.ri.tokenizer.StopWordFilter.java

public StopWordFilter(Tokenizer tok, Collection<String> stopWords) {
    super(tok);
    this.stopWords = ImmutableSet.copyOf(stopWords);
}

From source file:org.voltcore.messaging.SiteFailureForwardMessage.java

public SiteFailureForwardMessage(SiteFailureMessage sfm) {
    m_reportingHSId = sfm.m_sourceHSId;/*from  w  w w  .j a  v  a  2s .  c o  m*/
    m_survivors = ImmutableSet.copyOf(sfm.m_survivors);
    m_failed = ImmutableSet.copyOf(sfm.m_failed);
    m_safeTxnIds = ImmutableMap.copyOf(sfm.m_safeTxnIds);
}

From source file:com.netflix.atlas.client.interpreter.InQuery.java

InQuery(String k, Collection<String> values) {
    super(k);
    this.values = ImmutableSet.copyOf(values);
    Preconditions.checkArgument(values.size() >= 1);
}

From source file:com.dampcake.gson.immutable.ImmutableSetAdapter.java

/**
 * @see DelegateAdapter#transform(Object)
 */
@Override
protected Set<?> transform(Set<?> set) {
    return ImmutableSet.copyOf(set);
}

From source file:com.google.devtools.build.skyframe.DirtyKeyTrackerImpl.java

@Override
public Set<SkyKey> getDirtyKeys() {
    return ImmutableSet.copyOf(dirtyKeys);
}

From source file:org.apache.calcite.sql2rel.DeduplicateCorrelateVariables.java

/**
 * Rewrites a relational expression, replacing alternate correlation variables
 * with a canonical correlation variable.
 *//*from  w  w  w  .  ja v  a2 s  .c o m*/
public static RelNode go(RexBuilder builder, CorrelationId canonicalId,
        Iterable<? extends CorrelationId> alternateIds, RelNode r) {
    return r.accept(new DeduplicateCorrelateVariables(builder, canonicalId, ImmutableSet.copyOf(alternateIds)));
}

From source file:com.facebook.buck.java.InstrumentStep.java

public InstrumentStep(String mode, Set<Path> instrumentDirectories) {
    this.mode = mode;
    this.instrumentDirectories = ImmutableSet.copyOf(instrumentDirectories);
}

From source file:io.usethesource.criterion.impl.immutable.guava.ImmutableGuavaSet.java

@Override
public JmhSet insert(JmhValue key) {
    final HashSet<JmhValue> tmpContent = new HashSet<>(content);
    tmpContent.add(key);//from  ww  w .  ja  v  a 2s  . c  o m

    final ImmutableSet<JmhValue> newContent = ImmutableSet.copyOf(tmpContent);

    return new ImmutableGuavaSet(newContent);

    //    final ImmutableSet<JmhValue> newContent =
    //        ImmutableSet.<JmhValue>builder().addAll(content).add(key).build();
    //
    //    return new ImmutableGuavaSet(newContent);
}

From source file:org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ArtifactBackedArtifactSet.java

private ArtifactBackedArtifactSet(Collection<? extends ResolvedArtifact> artifacts) {
    this.artifacts = ImmutableSet.copyOf(artifacts);
}

From source file:org.j8ql.def.TableDef.java

public TableDef(Map tableMap) {
    this.name = (String) tableMap.get("table_name");

    // get the ids
    List<Map> ids = (List<Map>) tableMap.get("ids");
    int idColumnsSize = ids.size();
    String[] idNames = new String[idColumnsSize];
    String columnName = null;/*from w ww .ja v  a 2  s .  c o  m*/
    for (int i = 0, c = idColumnsSize; i < c; i++) {
        Map columnMap = ids.get(i);
        columnName = (String) columnMap.get("column_name");
        idNames[i] = columnName;
    }
    idColumnNames = ImmutableSet.copyOf(idNames);

    if (idColumnNames.size() == 1) {
        singleIdColumn = columnName;
    }

    // get the table columns
    Map<String, ColumnDef> colDefByName = new HashMap<>();
    List<Map> columnMapList = (List<Map>) tableMap.get("columns");
    for (Map col : columnMapList) {
        columnName = (String) col.get("COLUMN_NAME");
        ColumnDef colDef = new ColumnDef(columnName, col, idColumnNames.contains(columnName));
        colDefByName.put(columnName, colDef);
    }
    this.colDefByName = ImmutableMap.copyOf(colDefByName);

}