Example usage for com.google.common.collect ImmutableSet of

List of usage examples for com.google.common.collect ImmutableSet of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSet of.

Prototype

public static <E> ImmutableSet<E> of(E element) 

Source Link

Usage

From source file:org.sonar.server.qualityprofile.QProfileActivityQuery.java

public QProfileActivityQuery() {
    super();
    this.setTypes(ImmutableSet.of(Activity.Type.QPROFILE));
    qprofileKeys = Lists.newArrayList();
}

From source file:eu.redzoo.article.planetcassandra.reactive.service.SessionBuilder.java

public Session build() {
    return Cluster.builder().addContactPointsWithPorts(ImmutableSet.of(new InetSocketAddress(host, port)))
            .build().connect(keyspace);
}

From source file:de.metas.ui.web.window.datatypes.DocumentIdsSelection.java

public static DocumentIdsSelection fromNullable(final DocumentId documentId) {
    return documentId != null ? new DocumentIdsSelection(false, ImmutableSet.of(documentId)) : EMPTY;
}

From source file:com.spotify.heroic.aggregation.simple.AverageInstance.java

@ConstructorProperties({ "size", "extent" })
public AverageInstance(final long size, final long extent) {
    super(size, extent, ImmutableSet.of(MetricType.POINT), MetricType.POINT);
}

From source file:com.google.enterprise.adaptor.filenet.FileNetProxies.java

@Override
public Connection getConnection(String contentEngineUri, String username, String password)
        throws EngineRuntimeException {
    return new Connection(
            Proxies.newProxyInstance(com.filenet.api.core.Connection.class,
                    new FileNetConnectionMock(contentEngineUri)),
            new Subject(true, ImmutableSet.<Principal>of(), ImmutableSet.of(username),
                    ImmutableSet.of(password)));
}

From source file:com.b2international.snowowl.snomed.datastore.id.request.AbstractSnomedIdentifierEnumeratedRequestBuilder.java

public B setComponentId(String componentId) {
    this.componentIds = ImmutableSet.of(componentId);
    return getSelf();
}

From source file:com.facebook.buck.jvm.java.DefaultSuggestBuildRules.java

/**
 * @return A function that takes a list of failed imports from a javac invocation and returns a
 *    set of rules to suggest that the developer import to satisfy those imports.
 *//* w  ww .j  a v  a 2s  .  co  m*/
static SuggestBuildRules createSuggestBuildFunction(final JarResolver jarResolver,
        final ImmutableSet<JavaLibrary> declaredDeps, final ImmutableSet<JavaLibrary> transitiveDeps,
        final Iterable<BuildRule> buildRules) {

    final Supplier<ImmutableList<JavaLibrary>> sortedTransitiveNotDeclaredDeps = Suppliers
            .memoize(new Supplier<ImmutableList<JavaLibrary>>() {
                @Override
                public ImmutableList<JavaLibrary> get() {
                    Set<JavaLibrary> transitiveNotDeclaredDeps = Sets.difference(transitiveDeps,
                            Sets.union(ImmutableSet.of(this), declaredDeps));
                    DirectedAcyclicGraph<BuildRule> graph = BuildRuleDependencyVisitors
                            .getBuildRuleDirectedGraphFilteredBy(buildRules, JavaLibrary.class::isInstance,
                                    JavaLibrary.class::isInstance);
                    return FluentIterable.from(TopologicalSort.sort(graph)).filter(JavaLibrary.class)
                            .filter(transitiveNotDeclaredDeps::contains).toList().reverse();
                }
            });

    return new DefaultSuggestBuildRules(sortedTransitiveNotDeclaredDeps, jarResolver);
}

From source file:com.facebook.buck.rules.AbstractDependencyVisitor.java

public AbstractDependencyVisitor(BuildRule initialRule, boolean excludeRoot) {
    this(excludeRoot ? initialRule.getDeps() : ImmutableSet.of(initialRule));
}

From source file:grakn.core.graql.gremlin.sets.RegexFragmentSet.java

@Override
public final Set<Fragment> fragments() {
    return ImmutableSet.of(Fragments.regex(varProperty(), attributeType(), regex()));
}

From source file:org.jclouds.cloudstack.options.ListCapacityOptions.java

public ListCapacityOptions hostId(String hostId) {
    this.queryParameters.replaceValues("hostid", ImmutableSet.of(hostId + ""));
    return this;
}