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:dagger2.internal.codegen.ResolvedBindings.java

static ResolvedBindings create(BindingKey bindingKey, Binding... ownedBindings) {
    ImmutableSet<Binding> bindings = ImmutableSet.copyOf(ownedBindings);
    return new AutoValue_ResolvedBindings(bindingKey, bindings, bindings);
}

From source file:edu.uci.ics.sourcerer.tools.java.component.model.jar.JarSet.java

private static JarSet create(Set<Jar> set) {
    Reference<JarSet> ref = sets.get(set);
    JarSet result = ref == null ? null : ref.get();
    if (result == null) {
        result = new JarSet(ImmutableSet.copyOf(set));
        sets.put(result.jars, new WeakReference<>(result));
    }/*w w w . j ava  2  s. com*/
    return result;
}

From source file:com.axemblr.service.cm.models.cm.RoleNameList.java

public RoleNameList(String... roles) {
    this(ImmutableSet.copyOf(roles));
}

From source file:net.conquiris.lucene.document.FieldSelectors.java

/**
 * Creates a mapper with a selector that loads a certain set of fields eagerly, another set lazily
 * and the rest are not loaded./* ww w.j  a  va2  s.  c  om*/
 * @param fieldsToLoad Fields to load eagerly.
 * @param fieldsToLoadLazily Fields to load lazily.
 * @throws NullPointerException if any of the argument or any of their members is {@code null}.
 */
public static FieldSelector loadFields(Iterable<String> fieldsToLoad, Iterable<String> fieldsToLoadLazily) {
    Set<String> eager = ImmutableSet.copyOf(fieldsToLoad);
    Set<String> lazy = ImmutableSet.copyOf(fieldsToLoadLazily);
    return new SetBasedFieldSelector(eager, lazy);
}

From source file:com.yahoo.yqlplus.language.logical.JavaUnionTypeChecker.java

public JavaUnionTypeChecker(Operator parent, int idx, Class<?>... types) {
    super(parent, idx);
    this.types = ImmutableSet.copyOf(types);
}

From source file:org.jgrades.admin.api.model.WorkingDays.java

public Set<DayOfWeek> getDays() {
    return ImmutableSet.copyOf(daysSet);
}

From source file:com.tngtech.archunit.base.PackageMatchers.java

@PublicAPI(usage = ACCESS)
public static PackageMatchers of(Collection<String> packageIdentifiers) {
    return new PackageMatchers(ImmutableSet.copyOf(packageIdentifiers));
}

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

@JsonCreator
public ClusterList(@JsonProperty("items") Set<Cluster> items) {
    this.items = (items == null) ? ImmutableSet.<Cluster>of() : ImmutableSet.copyOf(items);
}

From source file:org.apache.whirr.service.vblob.CommonsConfigurationToVBlobConfig.java

@SuppressWarnings("unchecked")
static String getPropertyOrThrowReasonableNPE(String propertyKey, Configuration config) {
    return checkNotNull(config.getString(propertyKey), "%s not in %s", propertyKey,
            ImmutableSet.copyOf(config.getKeys()));
}

From source file:com.axemblr.service.cm.models.cm.RoleTypeList.java

public RoleTypeList(RoleType... items) {
    this(ImmutableSet.copyOf(items));
}