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.jgaap.generics.FilterEventCuller.java

public void init(List<EventSet> eventSets) throws EventCullingException {
    events = ImmutableSet.copyOf(train(eventSets));
}

From source file:io.prestosql.plugin.base.security.TableAccessControlRule.java

@JsonCreator
public TableAccessControlRule(@JsonProperty("privileges") Set<TablePrivilege> privileges,
        @JsonProperty("user") Optional<Pattern> userRegex,
        @JsonProperty("schema") Optional<Pattern> schemaRegex,
        @JsonProperty("table") Optional<Pattern> tableRegex) {
    this.privileges = ImmutableSet.copyOf(requireNonNull(privileges, "privileges is null"));
    this.userRegex = requireNonNull(userRegex, "userRegex is null");
    this.schemaRegex = requireNonNull(schemaRegex, "sourceRegex is null");
    this.tableRegex = requireNonNull(tableRegex, "tableRegex is null");
}

From source file:com.wrmsr.wava.java.lang.tree.declaration.JType.java

public JType(Set<JAccess> access, Kind kind, JName name, List<JInheritance> inheritances,
        List<JDeclaration> body) {
    this.access = ImmutableSet.copyOf(access);
    this.kind = requireNonNull(kind);
    this.name = requireNonNull(name);
    this.inheritances = ImmutableList.copyOf(inheritances);
    this.body = ImmutableList.copyOf(body);
}

From source file:com.b2international.commons.graph.DfsReachabilityService.java

/**
 * Returns the set of nodes reachable from the specified source node.
 * // ww  w.  java2 s .co  m
 * @param graph
 * @param sourceNode
 * @return the set of reachable nodes
 */
public Set<N> getReachableNodes(DirectedGraph<N, DirectedEdge<N>> graph, N sourceNode) {
    HashSet<DirectedEdge<N>> reachableEdges = Sets.<DirectedEdge<N>>newHashSet();
    HashSet<N> reachableNodes = Sets.<N>newHashSet();
    dfs(graph, sourceNode, reachableNodes, reachableEdges);
    return ImmutableSet.copyOf(reachableNodes);
}

From source file:com.b2international.snowowl.snomed.datastore.index.constraint.CompositeDefinitionFragment.java

@JsonCreator
public CompositeDefinitionFragment(@JsonProperty("uuid") final String uuid,
        @JsonProperty("active") final boolean active, @JsonProperty("effectiveTime") final long effectiveTime,
        @JsonProperty("author") final String author,
        @JsonProperty("children") final Set<ConceptSetDefinitionFragment> children) {

    super(uuid, active, effectiveTime, author);
    this.children = ImmutableSet.copyOf(children);
}

From source file:com.android.ide.common.rendering.FilteredClassLoader.java

/**
 * @param parent parent ClassLoader instance
 * @param filteredClasses the list of class names to filter with the format package.ClassName
 *///from   ww w. j  a v  a2 s . c  o m
FilteredClassLoader(@NonNull ClassLoader parent, @NonNull Set<String> filteredClasses) {
    super(parent);

    myFilteredClasses = ImmutableSet.copyOf(filteredClasses);
}

From source file:org.javersion.object.types.ObjectCreator.java

public ObjectCreator(StaticExecutable creator, List<String> parameters) {
    this(creator, ImmutableSet.copyOf(parameters));
}

From source file:org.opendaylight.yangtools.yang.data.impl.codec.BitsStringCodec.java

@SuppressWarnings("unchecked")
private BitsStringCodec(final Optional<BitsTypeDefinition> typeDef) {
    super(typeDef, (Class<Set<String>>) ((Class<?>) Set.class));
    if (typeDef.isPresent()) {
        validBits = ImmutableSet.copyOf(Collections2.transform(typeDef.get().getBits(), Bit::getName));
    } else {//from   www  . j a va2  s  .c  o  m
        validBits = null;
    }
}

From source file:io.mindmaps.graql.internal.query.predicate.AbstractValuePredicate.java

@Override
public ValuePredicate and(ValuePredicate other) {
    ImmutableSet<Object> innerUnion = ImmutableSet
            .copyOf(Sets.union(innerValues, other.admin().getInnerValues()));
    return new AndPredicate(this, other.admin(), innerUnion);
}

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

public JavaLibraryBuilder addAllAnnotationProcessors(List<String> processorNames) {
    arg.annotationProcessors = Optional.of(ImmutableSet.copyOf(processorNames));
    return this;
}