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.opengamma.strata.calc.runner.UnresolvableTargetCalculationFunction.java

@Override
public Set<Measure> supportedMeasures() {
    // pass all measures here so that the calculation is run to get the correct error message
    return ImmutableSet.copyOf(Measure.extendedEnum().lookupAllNormalized().values());
}

From source file:com.github.lightdocs.model.Resource.java

public Set<Operation> getOperations() {
    return ImmutableSet.copyOf(operations.values());
}

From source file:io.prestosql.sql.planner.iterative.rule.PruneOutputColumns.java

@Override
public Result apply(OutputNode outputNode, Captures captures, Context context) {
    return restrictChildOutputs(context.getIdAllocator(), outputNode,
            ImmutableSet.copyOf(outputNode.getOutputSymbols())).map(Result::ofPlanNode).orElse(Result.empty());
}

From source file:org.apache.gobblin.metrics.TagBasedMetricFilter.java

public TagBasedMetricFilter(Collection<Tag<?>> tags) {
    this.tags = ImmutableSet.copyOf(tags);
}

From source file:org.hawkular.metrics.model.param.TagNames.java

/**
 * Null or blank names are not permitted.
 *//*from  w w w .j ava2s.  c  o  m*/
public TagNames(Set<String> names) {
    checkArgument(names != null, "names is null");
    checkArgument(names.stream().allMatch(Tags::isValid), "Invalid tag name: %s", names);
    this.names = ImmutableSet.copyOf(names);
}

From source file:com.atlassian.jira.rest.client.internal.json.BasicProjectRoleJsonParser.java

@Override
public Collection<BasicProjectRole> parse(@Nullable final JSONObject json) throws JSONException {
    return json == null ? ImmutableSet.<BasicProjectRole>of()
            : ImmutableSet.copyOf(Iterators.transform(JsonParseUtil.getStringKeys(json),
                    new Function<String, BasicProjectRole>() {
                        @Override
                        public BasicProjectRole apply(@Nullable final String key) {
                            try {
                                return new BasicProjectRole(JsonParseUtil.parseURI(json.getString(key)), key);
                            } catch (JSONException e) {
                                throw new RestClientException(e);
                            }//w w w. j a v  a  2  s . c  o m
                        }
                    }));
}

From source file:org.gradle.api.internal.tasks.compile.incremental.deps.ClassAnalysis.java

public ClassAnalysis(String className, Set<String> classDependencies, boolean dependencyToAll, IntSet constants,
        Set<String> superTypes) {
    this.className = className;
    this.classDependencies = ImmutableSet.copyOf(classDependencies);
    this.dependencyToAll = dependencyToAll;
    this.constants = constants.isEmpty() ? IntSets.EMPTY_SET : constants;
    this.superTypes = ImmutableSet.copyOf(superTypes);
}

From source file:org.dcache.auth.attributes.PrefixRestriction.java

public PrefixRestriction(FsPath... prefixes) {
    this.prefixes = ImmutableSet.copyOf(prefixes);
}

From source file:com.vmware.photon.controller.common.thrift.StaticServerSet.java

@Inject
public StaticServerSet(@Assisted InetSocketAddress... servers) {
    this.listeners = Collections.synchronizedSet(new HashSet<ChangeListener>());
    this.servers = ImmutableSet.copyOf(servers);
}

From source file:neon.common.event.ConfigurationEvent.java

/**
 * Initializes this event with game configuration data.
 * //from w  ww. j  a  v a  2s .  c  o  m
 * @param config
 */
public ConfigurationEvent(CClient cc, CServer cs) {
    modules = ImmutableSet.copyOf(cs.getModules());
    title = cc.title;
    subtitle = cc.subtitle;
}