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.jclouds.compute.predicates.NodeRunning.java

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

From source file:tile80.behaviors80.BeamEmitter.java

@Override
public Iterable<Tile80> crunch(Tile80 self, World80 world, Set<String> event) {
    Tile80 sw = world.getTileById(self.getFromKeyspace("switch"));
    if (sw.getTags().contains("on")) {
        return ImmutableSet.of(self.addTag("emit"),
                Tile80.newEmpty("beam")
                        .setPos(self.getX() + Integer.parseInt(self.getFromKeyspace("rx")),
                                self.getY() + Integer.parseInt(self.getFromKeyspace("ry")))
                        .addKey("sprite", "beamVertical").addBehavior(new Beam()));
    }/*  w  w  w . j  a va  2s .c  o m*/
    return ImmutableSet.of(self.removeTag("emit"));
}

From source file:com.google.gerrit.index.IndexUtils.java

public static Set<String> fields(QueryOptions opts) {
    // Ensure we request enough fields to construct a ChangeData. We need both
    // change ID and project, which can either come via the Change field or
    // separate fields.
    Set<String> fs = opts.fields();
    if (fs.contains(CHANGE.getName())) {
        // A Change is always sufficient.
        return fs;
    }//from   w  w w . j  a  v a 2 s  .  c  o m
    if (fs.contains(PROJECT.getName()) && fs.contains(LEGACY_ID.getName())) {
        return fs;
    }
    return Sets.union(fs, ImmutableSet.of(LEGACY_ID.getName(), PROJECT.getName()));
}

From source file:org.eclipse.che.api.workspace.server.stack.StackMessageBodyAdapter.java

@Override
public Set<Class<?>> getTriggers() {
    return ImmutableSet.of(Stack.class, StackDto.class);
}

From source file:com.streamsets.pipeline.stage.cloudstorage.origin.GCSFileRef.java

public GCSFileRef(Blob blob, int bufferSize, boolean createMetrics, long fileSize, double rateLimit,
        boolean verifyChecksum, String checksum, HashingUtil.HashType checksumAlgorithm) {
    super(ImmutableSet.of(InputStream.class, ReadableByteChannel.class), bufferSize, createMetrics, fileSize,
            rateLimit, verifyChecksum, checksum, checksumAlgorithm);
    this.blob = blob;
}

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

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

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

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

From source file:io.ytcode.reflect.util.Example.java

private static void scanner() {
    Resources rs1 = Scanner.pkgs("io.ytcode.reflect").scan();
    for (Resource r : rs1) {
        System.out.println(r);/*ww  w . j  a v a2  s. co m*/
    }

    Resources rs2 = Scanner.paths("/io/ytcode/reflect/").scan();
    System.out.println(rs2.size());

    Resources rs3 = Scanner.paths("/").scan();
    System.out.println(rs3.size());

    Resources rs4 = Scanner.from(
            ImmutableSet.of(ClassLoader.getSystemClassLoader(), ClassLoader.getSystemClassLoader().getParent()),
            ImmutableSet.of("/io/ytcode/reflect/clazz/", "/io/ytcode/reflect/resource/"), false).scan();
    System.out.println(rs4.size());
}

From source file:ai.grakn.generator.RuleTypes.java

@Override
protected Collection<RuleType> otherMetaTypes() {
    return ImmutableSet.of(graph().admin().getMetaRuleInference(), graph().admin().getMetaRuleConstraint());
}

From source file:com.nomsic.sid.Match.java

public Match(String recordId1, String recordId2) {
    this.records = ImmutableSet.of(recordId1, recordId2);
}