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:org.gradle.swiftpm.internal.DefaultTarget.java

public DefaultTarget(String name, File path, Iterable<File> sourceFiles) {
    this.name = name;
    this.path = path;
    this.sourceFiles = ImmutableSet.copyOf(sourceFiles);
}

From source file:com.spotify.reaper.storage.postgresql.RepairScheduleStatusMapper.java

@Override
public RepairScheduleStatus map(int index, ResultSet r, StatementContext ctx) throws SQLException {
    return new RepairScheduleStatus(r.getLong("id"), r.getString("owner"), r.getString("cluster_name"),
            r.getString("keyspace_name"),
            ImmutableSet.copyOf((String[]) r.getArray("column_families").getArray()),
            RepairSchedule.State.valueOf(r.getString("state")),
            RepairRunMapper.getDateTimeOrNull(r, "creation_time"),
            RepairRunMapper.getDateTimeOrNull(r, "next_activation"),
            RepairRunMapper.getDateTimeOrNull(r, "pause_time"), r.getDouble("intensity"),
            r.getInt("segment_count"), RepairParallelism.valueOf(r.getString("repair_parallelism")),
            r.getInt("days_between"));
}

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

public JField(Set<JAccess> access, JTypeSpecifier type, JName name, Optional<JExpression> value) {
    this.access = ImmutableSet.copyOf(access);
    this.type = requireNonNull(type);
    this.name = requireNonNull(name);
    this.value = requireNonNull(value);
}

From source file:org.apache.brooklyn.location.jclouds.pool.MachineSet.java

public MachineSet(Iterable<? extends NodeMetadata> m) {
    members = ImmutableSet.copyOf(m);
}

From source file:org.gradle.api.internal.project.taskfactory.TaskClassValidator.java

public TaskClassValidator(Set<TaskPropertyInfo> validatedProperties, Set<String> nonAnnotatedPropertyNames) {
    this.validatedProperties = ImmutableSet.copyOf(validatedProperties);
    this.nonAnnotatedPropertyNames = ImmutableSet.copyOf(nonAnnotatedPropertyNames);
}

From source file:com.tngtech.archunit.library.plantuml.PlantUmlDiagram.java

Set<PlantUmlComponent> getComponentsWithAlias() {
    return ImmutableSet.copyOf(plantUmlComponents.getComponentsWithAlias());
}

From source file:org.trancecode.collection.TcSets.java

public static <T> ImmutableSet<T> immutableSetWithout(final Iterable<T> elements, final T element) {
    Preconditions.checkNotNull(elements);
    Preconditions.checkNotNull(element);

    if (elements instanceof Set && !((Set<?>) elements).contains(element)) {
        return ImmutableSet.copyOf(elements);
    }//from  ww w. ja v a 2s.c  o m

    return ImmutableSet.copyOf(Iterables.filter(elements, Predicates.not(Predicates.equalTo(element))));
}

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

/**
 * @return the groups
 */
public Set<Group> getGroups() {
    return groups == null ? ImmutableSet.<Group>of() : ImmutableSet.copyOf(groups);
}

From source file:com.google.inject.spi.Dependency.java

/**
 * Returns the dependencies from the given injection points.
 *///from  w  w w.j a va 2 s.  c  o  m
public static Set<Dependency<?>> forInjectionPoints(Set<InjectionPoint> injectionPoints) {
    List<Dependency<?>> dependencies = Lists.newArrayList();
    for (InjectionPoint injectionPoint : injectionPoints) {
        dependencies.addAll(injectionPoint.getDependencies());
    }
    return ImmutableSet.copyOf(dependencies);
}

From source file:com.uber.stream.kafka.mirrormaker.controller.core.InstanceTopicPartitionHolder.java

public Set<TopicPartition> getServingTopicPartitionSet() {
    return ImmutableSet.copyOf(_topicPartitionSet);
}