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, E e3) 

Source Link

Usage

From source file:edu.cmu.lti.oaqa.baseqa.answer_type.QuestionAnswerTypes.java

public static void main(String[] args) {
    Gson gson = getGson();/*from   www .j  a  v  a2  s . c  om*/
    QuestionAnswerTypes qat = new QuestionAnswerTypes("test-001", "What is this?");
    qat.addAnswerTypes("aaa", ImmutableSet.of("t1", "t2", "t3"));
    qat.addAnswerTypes("bbb", ImmutableSet.of("t1", "t4", "t5"));
    qat.addAnswerTypes("ccc", ImmutableSet.of());
    String json = gson.toJson(qat, QuestionAnswerTypes.class);
    System.out.println(json);
    QuestionAnswerTypes obj = gson.fromJson(json, QuestionAnswerTypes.class);
    System.out.println(obj.getAnswerTypes());
}

From source file:com.yahoo.elide.tests.EmbeddedIT.java

@BeforeTest
public static void setup() throws IOException {
    DataStoreTransaction tx = dataStore.beginTransaction();
    Embedded embedded = new Embedded(); // id 1
    embedded.setSegmentIds(ImmutableSet.of(3L, 4L, 5L));

    tx.save(embedded);//from  www .  java2s. c o  m

    Left left = new Left();
    Right right = new Right();

    left.setOne2one(right);
    right.setOne2one(left);

    tx.save(left);
    tx.save(right);

    tx.commit();
}

From source file:com.yahoo.elide.endpoints.EmbeddedIT.java

@BeforeTest
public static void setup() throws IOException {
    DatabaseTransaction tx = hibernateManager.beginTransaction();
    Embedded embedded = new Embedded(); // id 1
    embedded.setSegmentIds(ImmutableSet.of(3L, 4L, 5L));

    tx.save(embedded);/*  ww  w.  j  a va 2s. c om*/

    Left left = new Left();
    Right right = new Right();

    left.setOne2one(right);
    right.setOne2one(left);

    tx.save(left);
    tx.save(right);

    tx.commit();
}

From source file:com.facebook.buck.io.watchman.FakeWatchmanFactory.java

/**
 * Create Watchman instance that can be used in tests
 *
 * @param client client instance used by a test, usually FakeWatchmanClient, can be configured for
 *     specified behavior//w  w w.jav  a2  s .c  o  m
 * @param rootPath Absolute path to watchman root folder
 * @param watchPath Path to watch changes for
 * @param projectName Identifier of a watch used to get results from queries
 */
public static Watchman createWatchman(WatchmanClient client, Path rootPath, Path watchPath,
        String projectName) {
    return new Watchman(
            ImmutableMap.of(rootPath, ProjectWatch.of(watchPath.toString(), Optional.of(projectName))),
            ImmutableSet.of(Capability.SUPPORTS_PROJECT_WATCH, Capability.DIRNAME, Capability.WILDMATCH_GLOB),
            ImmutableMap.of(), Optional.of(Paths.get(".watchman-sock"))) {
        @Override
        public WatchmanClient createClient() {
            return client;
        }
    };
}

From source file:azkaban.jobs.builtin.RubyJob.java

public RubyJob(JobDescriptor desc) {
    super(new String[] { desc.getProps().getString(RUBY_BINARY_KEY, "ruby"),
            desc.getProps().getString(SCRIPT_KEY) }, desc,
            ImmutableSet.of(RUBY_BINARY_KEY, SCRIPT_KEY, JobDescriptor.JOB_TYPE));
}

From source file:azkaban.jobs.PythonJob.java

public PythonJob(JobDescriptor desc) {
    super(new String[] { desc.getProps().getString(PYTHON_BINARY_KEY, "python"),
            desc.getProps().getString(SCRIPT_KEY) }, desc,
            ImmutableSet.of(PYTHON_BINARY_KEY, SCRIPT_KEY, JobDescriptor.JOB_TYPE));
}

From source file:azkaban.jobExecutor.RubyJob.java

public RubyJob(String jobid, Props sysProps, Props jobProps, Logger log) {
    super(jobid, new String[] { jobProps.getString(RUBY_BINARY_KEY, "ruby"), jobProps.getString(SCRIPT_KEY) },
            sysProps, jobProps, log, ImmutableSet.of(RUBY_BINARY_KEY, SCRIPT_KEY, JOB_TYPE));
}

From source file:com.tngtech.archunit.core.importer.ModuleImportPlugin.java

@Override
public void plugInLocationFactories(InitialConfiguration<Set<Location.Factory>> factories) {
    factories.set(ImmutableSet.of(new Location.JarFileLocationFactory(), new Location.FilePathLocationFactory(),
            new ModuleLocationFactory()));
}

From source file:azkaban.jobExecutor.PythonJob.java

public PythonJob(String jobid, Props sysProps, Props jobProps, Logger log) {
    super(jobid,/*from www . jav  a2 s. c  o  m*/
            new String[] { jobProps.getString(PYTHON_BINARY_KEY, "python"), jobProps.getString(SCRIPT_KEY) },
            sysProps, jobProps, log, ImmutableSet.of(PYTHON_BINARY_KEY, SCRIPT_KEY, JOB_TYPE));
}

From source file:com.opengamma.web.server.WebViewPrimitivesGrid.java

protected WebViewPrimitivesGrid(ViewClient viewClient, CompiledViewDefinition compiledViewDefinition,
        ResultConverterCache resultConverterCache, LocalSession local, ServerSession remote,
        ComputationTargetResolver computationTargetResolver) {
    super("primitives", viewClient, compiledViewDefinition, null,
            ImmutableSet.of(ComputationTargetType.PRIMITIVE, ComputationTargetType.CURRENCY,
                    ComputationTargetType.UNORDERED_CURRENCY_PAIR),
            resultConverterCache, local, remote, "", computationTargetResolver);
}