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.graylog2.indexer.indices.events.IndicesClosedEvent.java

public static IndicesClosedEvent create(String index) {
    return new AutoValue_IndicesClosedEvent(ImmutableSet.of(index));
}

From source file:org.graylog2.indexer.indices.events.IndicesDeletedEvent.java

public static IndicesDeletedEvent create(String index) {
    return new AutoValue_IndicesDeletedEvent(ImmutableSet.of(index));
}

From source file:org.graylog2.indexer.indices.events.IndicesReopenedEvent.java

public static IndicesReopenedEvent create(String index) {
    return new AutoValue_IndicesReopenedEvent(ImmutableSet.of(index));
}

From source file:com.teradata.tempto.Requirements.java

public static CompositeRequirement compose(List<Requirement> requirements) {
    return new MultiCompositeRequirement(ImmutableSet.of(copyOf(wrapAsCompositeRequirements(requirements))));
}

From source file:com.google.caliper.runner.target.TargetModule.java

@Singleton
@Provides/*  ww w  . ja va2s .  co m*/
static ImmutableSet<Target> provideTargets(Device device, CaliperOptions options, CaliperConfig config) {
    ImmutableSet<String> vmNames = options.vmNames();
    if (vmNames.isEmpty()) {
        return ImmutableSet.of(device.createDefaultTarget());
    }

    ImmutableSet.Builder<Target> builder = ImmutableSet.builder();
    for (String vmName : vmNames) {
        builder.add(device.createTarget(config.getVmConfig(vmName)));
    }
    return builder.build();
}

From source file:com.spotify.heroic.aggregation.AggregationData.java

public static AggregationData forSeries(Series s, MetricCollection metrics) {
    return new AggregationData(s.getTags(), ImmutableSet.of(s), metrics);
}

From source file:com.spotify.heroic.aggregation.AggregationState.java

/**
 * Create a state that only contains a single time series.
 *
 * @param s The time series contained in the state.
 * @return The new traverse state./*w w  w .j a v  a 2  s. co  m*/
 */
public static AggregationState forSeries(Series s) {
    return new AggregationState(s.getTags(), ImmutableSet.of(s));
}

From source file:google.registry.groups.GroupssettingsModule.java

@Provides
static Groupssettings provideDirectory(@Named("delegatedAdmin") GoogleCredential credential,
        @Config("projectId") String projectId) {
    return new Groupssettings.Builder(credential.getTransport(), credential.getJsonFactory(),
            credential.createScoped(ImmutableSet.of(GroupssettingsScopes.APPS_GROUPS_SETTINGS)))
                    .setApplicationName(projectId).build();
}

From source file:com.wrmsr.wava.util.collect.MoreOptionals.java

public static <T> Set<T> optionalToSet(Optional<T> o) {
    if (o.isPresent()) {
        return ImmutableSet.of(o.get());
    } else {//w w  w  .j  ava  2  s .c  o  m
        return ImmutableSet.of();
    }
}

From source file:com.google.javascript.refactoring.testing.SuggestedFixes.java

public static void assertReplacement(SuggestedFix fix, CodeReplacement expectedReplacement) {
    assertReplacements(fix, ImmutableSet.of(expectedReplacement));
}