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

@SuppressWarnings("unchecked")
    public static <E> ImmutableSet<E> of(E e1, E e2) 

Source Link

Usage

From source file:org.onosproject.mapping.web.gui.MappingsTopoMessageHandler.java

@Override
protected Collection<RequestHandler> createRequestHandlers() {
    return ImmutableSet.of(new DisplayStartHandler(), new DisplayStopHandler());
}

From source file:org.jclouds.compute.predicates.AtomicImageAvailable.java

@Inject
public AtomicImageAvailable(GetImageStrategy client) {
    super(Status.AVAILABLE, ImmutableSet.of(Status.ERROR, Status.DELETED), client);
}

From source file:com.ardor3d.extension.ui.UILabel.java

@Override
public ImmutableSet<UIState> getStates() {
    return ImmutableSet.of((UIState) _defaultState, _disabledState);
}

From source file:org.jclouds.compute.predicates.AtomicNodeRunning.java

@Inject
public AtomicNodeRunning(GetNodeMetadataStrategy client) {
    super(Status.RUNNING, ImmutableSet.of(Status.ERROR, Status.TERMINATED), client);
}

From source file:org.jclouds.compute.predicates.AtomicNodeSuspended.java

@Inject
public AtomicNodeSuspended(GetNodeMetadataStrategy client) {
    super(Status.SUSPENDED, ImmutableSet.of(Status.ERROR, Status.TERMINATED), client);
}

From source file:test.MultibindingProducerModule.java

@Produces(type = SET_VALUES)
Set<String> strs() {
    return ImmutableSet.of("bar1", "bar2");
}

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

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

From source file:org.sonar.javascript.cfg.BranchingBlock.java

@Override
public Set<MutableBlock> successors() {
    Preconditions.checkState(trueSuccessor != null, "Successors were not set on " + this);
    return ImmutableSet.of(trueSuccessor, falseSuccessor);
}

From source file:com.android.tools.idea.npw.AndroidModuleTemplatesProvider.java

/**
 * Helper method for requesting module templates associated with the specified metadata and
 * target form factors. Usually this is a 1:1 relationship, but, for example, the metadata for
 * the mobile form factor can be used to generate two separate module templates (one which acts
 * as a main entry point for your app, while the other acts as a library which can be shared
 * across apps).//from   w w w .  j a v  a 2s. c  o m
 */
@NotNull
private static Collection<ModuleTemplate> getModuleTemplates(@NotNull TemplateMetadata metadata,
        @NotNull FormFactor formFactor) {
    if (formFactor.equals(FormFactor.MOBILE)) {
        CreateModuleTemplate androidApplication = new CreateModuleTemplate(metadata, formFactor,
                "Phone & Tablet Module", AndroidIcons.ModuleTemplates.Mobile);
        androidApplication.setCustomValue(WizardConstants.IS_LIBRARY_KEY, false);
        CreateModuleTemplate androidLibrary = new CreateModuleTemplate(metadata, formFactor, "Android Library",
                AndroidIcons.ModuleTemplates.Android);
        androidLibrary.setCustomValue(WizardConstants.IS_LIBRARY_KEY, true);
        return ImmutableSet.of(androidApplication, androidLibrary);
    } else {
        return ImmutableSet.of(new CreateModuleTemplate(metadata, formFactor, metadata.getTitle(),
                getModuleTypeIcon(formFactor)));
    }
}

From source file:com.google.gerrit.server.config.GitUploadPackGroupsProvider.java

@Inject
public GitUploadPackGroupsProvider(GroupBackend gb, @GerritServerConfig Config config,
        ThreadLocalRequestContext threadContext, ServerRequestContext serverCtx) {
    super(gb, threadContext, serverCtx,
            ImmutableList.copyOf(config.getStringList("upload", null, "allowGroup")));

    // If no group was set, default to "registered users" and "anonymous"
    ///*from   w ww .  j  av a2  s .  c o m*/
    if (groupIds.isEmpty()) {
        groupIds = ImmutableSet.of(SystemGroupBackend.REGISTERED_USERS, SystemGroupBackend.ANONYMOUS_USERS);
    }
}