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:com.brighttag.agathon.security.SecurityGroupPermission.java

public SecurityGroupPermission(Collection<Netmask> netmasks, Range<Integer> portRange) {
    this.netmasks = ImmutableSet.copyOf(netmasks);
    this.portRange = portRange;
}

From source file:com.axemblr.service.cm.models.clusters.ServiceConfig.java

@JsonCreator
public ServiceConfig(@JsonProperty("items") List<Config> items,
        @JsonProperty("roleTypeConfigs") Set<RoleTypeConfig> roleTypeConfigs) {
    super(items);
    this.roleTypeConfigs = (roleTypeConfigs == null) ? ImmutableSet.<RoleTypeConfig>of()
            : ImmutableSet.copyOf(roleTypeConfigs);
}

From source file:org.onosproject.ofagent.impl.DefaultOFSwitchCapabilities.java

private DefaultOFSwitchCapabilities(Set<OFCapabilities> ofSwitchCapabilities) {
    this.ofCapabilities = ImmutableSet.copyOf(ofSwitchCapabilities);
}

From source file:com.google.caja.util.TypesafeSet.java

private TypesafeSet(Iterable<? extends T> els) {
    this.contents = ImmutableSet.copyOf(els);
}

From source file:com.b2international.index.revision.RevisionBranch.java

public RevisionBranch(String path, int segmentId, Collection<Integer> segments) {
    this.path = path;
    this.segmentId = segmentId;
    this.segments = ImmutableSet.copyOf(segments);
}

From source file:org.eclipse.sirius.ext.base.relations.UnionRelation.java

/**
 * Constructor./*from   w ww  .ja  va 2  s.c o  m*/
 * 
 * @param baseRelations
 *            the relations to consider in the union.
 */
public UnionRelation(Relation<T>... baseRelations) {
    this.baseRelations = ImmutableSet.copyOf(Iterators.forArray(Preconditions.checkNotNull(baseRelations)));
}

From source file:com.google.gxp.compiler.bind.BoundTree.java

public BoundTree(SourcePosition sourcePosition, AlertSet alerts, Root root, Set<Callable> requirements) {
    super(sourcePosition, alerts, root);
    this.requirements = ImmutableSet.copyOf(requirements);
}

From source file:com.complexible.common.openrdf.query.ImmutableBindingSet.java

public ImmutableBindingSet(final BindingSet theBindingSet) {
    super(theBindingSet);
    mBindingNames = ImmutableSet.copyOf(theBindingSet.getBindingNames());
}

From source file:io.airlift.jaxrs.BeanValidationException.java

public BeanValidationException(Set<ConstraintViolation<Object>> violations) {
    super(Joiner.on(", ").join(transform(violations, constraintMessageBuilder())));
    this.violations = ImmutableSet.copyOf(violations);
}

From source file:suneido.database.query.Update.java

@Override
public int execute() {
    Query q = source.transform();
    Set<String> cols = ImmutableSet.copyOf(q.columns());
    List<String> bestKey = q.key_index(cols);
    if (q.optimize(bestKey, cols, noNeeds, false, true) >= IMPOSSIBLE)
        throw new SuException("invalid query");
    q = q.addindex(tran);/*from  ww w .  j  av a 2 s. co m*/
    // cSuneido uses source.key_index
    // but this causes problems - maybe need transform first?
    //      List<String> bestKey = source.keys().get(0);
    //      Query q = source.setup();
    if (!q.updateable())
        throw new SuException("update: query not updateable");
    Header hdr = q.header();
    Row row;
    int n = 0;
    Record prevKey = null;
    while (null != (row = q.get(Dir.NEXT))) {
        Record key = row.project(hdr, bestKey);
        // avoid getting stuck on the same key
        // should maybe be in Btree Iter
        if (key.equals(prevKey))
            continue;
        prevKey = key;
        SuRecord surec = row.surec(hdr);
        for (int i = 0; i < fields.size(); ++i)
            surec.put(fields.get(i), exprs.get(i).eval(hdr, row));
        Record newrec = surec.toDbRecord(hdr);
        tran.updateRecord(q.tblnum(), row.firstData(), newrec);
        ++n;
    }
    return n;
}