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.squareup.javapoet.ParameterSpec.java

private ParameterSpec(Builder builder) {
    this.name = checkNotNull(builder.name, "name == null");
    this.annotations = ImmutableList.copyOf(builder.annotations);
    this.modifiers = ImmutableSet.copyOf(builder.modifiers);
    this.type = checkNotNull(builder.type, "type == null");
}

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

/**
 * {@inheritDoc}/*ww w.  j  a v  a2s  .co  m*/
 */
public Set<T> apply(T from) {
    Set<T> result = Sets.newHashSet();
    for (Relation<T> rel : baseRelations) {
        result.addAll(rel.apply(from));
    }
    return ImmutableSet.copyOf(result);
}

From source file:com.textocat.textokit.postagger.PosTrimmer.java

public PosTrimmer(GramModel gramModel, String... targetPosCategories) {
    this(gramModel, ImmutableSet.copyOf(targetPosCategories));
}

From source file:net.lmxm.ute.resources.types.ApplicationResourceType.java

ApplicationResourceType(final ResourceValueType... types) {
    this.types = ImmutableSet.copyOf(types);
}

From source file:org.elasticsearch.common.inject.internal.ProviderInstanceBindingImpl.java

public ProviderInstanceBindingImpl(Injector injector, Key<T> key, Object source,
        InternalFactory<? extends T> internalFactory, Scoping scoping, Provider<? extends T> providerInstance,
        Set<InjectionPoint> injectionPoints) {
    super(injector, key, source, internalFactory, scoping);
    this.providerInstance = providerInstance;
    this.injectionPoints = ImmutableSet.copyOf(injectionPoints);
}

From source file:eu.cloudwave.wp5.feedback.eclipse.base.core.handlers.HandlerToolkit.java

/**
 * Returns all projects that are currently selected.
 * //from w ww .ja va  2 s  .co  m
 * @param event
 *          {@link ExecutionEvent}
 * @return a {@link Set} containing all currently selected {@link IProject}'s
 */
public static Set<IProject> getSelectedProjects(final ExecutionEvent event) {
    final Set<IProject> selectedProjects = Sets.newHashSet();
    final ISelection selection = HandlerUtil.getCurrentSelection(event);
    if (selection instanceof IStructuredSelection) {
        final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
        for (final Iterator<?> it = structuredSelection.iterator(); it.hasNext();) {
            final Object selectedElement = it.next();
            if (selectedElement instanceof IProject) {
                selectedProjects.add((IProject) selectedElement);
            } else if (selectedElement instanceof IAdaptable) {
                selectedProjects.add((IProject) ((IAdaptable) selectedElement).getAdapter(IProject.class));
            }
        }
    }
    return ImmutableSet.copyOf(selectedProjects);
}

From source file:com.github.jtse.puzzle.util.ScriptModule.java

public ScriptModule(File scriptFile, String... repeatableKeys) {
    this.scriptFile = scriptFile;
    this.repeatableKeys = ImmutableSet.copyOf(repeatableKeys);
}

From source file:com.google.javascript.jscomp.DiagnosticGroup.java

/**
 * Create a group that matches all errors of the given types.
 */// w w w .  ja  v a  2 s  .c  o  m
DiagnosticGroup(String name, DiagnosticType... types) {
    this.name = name;
    this.types = ImmutableSet.copyOf(Arrays.asList(types));
}

From source file:org.jclouds.fujitsu.fgcp.domain.VServerWithDetails.java

public Set<VDisk> getVdisks() {
    return vdisks == null ? ImmutableSet.<VDisk>of() : ImmutableSet.copyOf(vdisks);
}

From source file:org.sosy_lab.cpachecker.cmdline.CmdLineArgument.java

CmdLineArgument(String... pNames) {
    names = ImmutableSet.copyOf(pNames);
}