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:com.github.benmanes.caffeine.cache.simulator.policy.product.ExpiringMapPolicy.java

/** Returns all variations of this policy based on the configuration parameters. */
public static Set<Policy> policies(Config config) {
    return ImmutableSet.of(new ExpiringMapPolicy(config));
}

From source file:com.github.benmanes.caffeine.cache.simulator.policy.sketch.tinycache.TinyCacheWithGhostCachePolicy.java

/** Returns all variations of this policy based on the configuration parameters. */
public static Set<Policy> policies(Config config) {
    return ImmutableSet.of(new TinyCacheWithGhostCachePolicy(config));
}

From source file:org.immutables.fixture.ValDerivedCollection.java

@Value.Derived
Set<Integer> available() {
    return ImmutableSet.of(1);
}

From source file:com.github.benmanes.caffeine.cache.simulator.policy.product.GuavaPolicy.java

/** Returns all variations of this policy based on the configuration parameters. */
public static Set<Policy> policies(Config config) {
    return ImmutableSet.of(new GuavaPolicy(config));
}

From source file:se.sics.caracaldb.operations.OpUtil.java

/**
 * Check and Set operation./*from   ww w . jav  a 2s . c o m*/
 * 
 * If value@key == oldValue set value@key = newValue.
 * 
 * @param k
 * @param oldValue
 * @param newValue
 * @return 
 */
public static MultiOpRequest cas(UUID id, Key key, byte[] oldValue, byte[] newValue) {
    Condition c = new EqualCondition(key, oldValue);
    return new MultiOpRequest(id, ImmutableSet.of(c), ImmutableMap.of(key, newValue),
            ImmutableMap.copyOf(new HashMap<Key, byte[]>())); // java6 is soooooo baaaadd -.-
}

From source file:org.jclouds.elasticstack.util.Servers.java

/**
 * Helper to create a small persistent server
 * /*from  w  ww  .j  av a 2 s.  c  o m*/
 * @param name
 *           what to name the server
 * @param driveUuuid
 *           id of the boot drive
 * @param vncPassword
 *           password for vnc
 * @return a builder for a persistent 1Ghz 512m server with DHCP enabled network.
 */
public static Server.Builder small(String name, String driveUuuid, String vncPassword) {
    return new Server.Builder().name(name).cpu(1000).mem(512).persistent(true)
            .devices(ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid(driveUuuid).build()))
            .bootDeviceIds(ImmutableSet.of("ide:0:0"))
            .nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).dhcp("auto").build()))
            .vnc(new VNC(null, vncPassword, false));
}

From source file:com.github.benmanes.caffeine.cache.simulator.policy.product.CaffeinePolicy.java

/** Returns all variations of this policy based on the configuration parameters. */
public static Set<Policy> policies(Config config) {
    return ImmutableSet.of(new CaffeinePolicy(config));
}

From source file:com.github.tomakehurst.wiremock.stubbing.Scenario.java

public static Scenario inStartedState(String name) {
    return new Scenario(UUID.randomUUID(), name, STARTED, ImmutableSet.of(STARTED));
}

From source file:org.gradle.api.internal.artifacts.configurations.DetachedConfigurationsProvider.java

public Set<ConfigurationInternal> getAll() {
    return ImmutableSet.of(theOnlyConfiguration);
}

From source file:gov.nih.nci.caarray.application.util.CaArrayFileSetNonSplitter.java

/**
 * {@inheritDoc}//from   ww w .  ja  v  a 2s .c  om
 */
@Override
public Set<CaArrayFileSet> split(CaArrayFileSet largeFileSet) throws IOException {
    return ImmutableSet.of(largeFileSet);
}