Example usage for com.google.common.collect ImmutableList of

List of usage examples for com.google.common.collect ImmutableList of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableList of.

Prototype

public static <E> ImmutableList<E> of(E element) 

Source Link

Usage

From source file:com.googlecode.jmxtrans.model.ResultFixtures.java

public static ImmutableList<Result> singleTrueResult() {
    return ImmutableList.of(booleanTrueResult());
}

From source file:com.opengamma.component.security.PermissiveLoginModule.java

@Override
public UserInfo getUserInfo(String username) throws Exception {
    return new UserInfo(username, new OpenGammaCredential(), ImmutableList.of("user"));
}

From source file:ro.cosu.vampires.server.actors.messages.configuration.QueryConfiguration.java

public static QueryConfiguration create(String resourceId, User user) {
    return new AutoValue_QueryConfiguration(ImmutableList.of(resourceId), user);
}

From source file:com.mysema.query.types.template.SimpleTemplate.java

public static <T> SimpleExpression<T> create(Class<? extends T> type, String template, Object one) {
    return new SimpleTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of(one));
}

From source file:io.crate.planner.consumer.SimpleSelect.java

public static void enablePagingIfApplicable(RoutedCollectPhase collectPhase, @Nullable MergePhase mergePhase,
        @Nullable Integer limit, int offset, String localNodeId) {
    if (mergePhase == null || limit == null || limit == TopN.NO_LIMIT || (limit + offset) < Paging.PAGE_SIZE) {
        return;/*from  www  . ja  v a  2s  .c  om*/
    }
    mergePhase.executionNodes(ImmutableList.of(localNodeId));

    if (collectPhase.nodePageSizeHint() != null) {
        // in the directResponse case nodePageSizeHint has probably be set to limit
        // since it is now push based we can reduce the nodePageSizeHint
        collectPhase.pageSizeHint(limit + offset);
    }
}

From source file:io.airlift.drift.client.address.SimpleAddressSelectorBinder.java

public static AddressSelectorBinder simpleAddressSelector(HostAndPort defaultAddress) {
    requireNonNull(defaultAddress, "defaultAddress is null");
    return new SimpleAddressSelectorBinder(Optional.of(ImmutableList.of(defaultAddress)));
}

From source file:io.prestosql.sql.tree.QualifiedName.java

public static QualifiedName of(String name) {
    requireNonNull(name, "name is null");
    return of(ImmutableList.of(new Identifier(name)));
}

From source file:com.spectralogic.ds3autogen.testutil.Ds3ResponseCodeFixture.java

/**
 * Creates a list of populated response codes for testing purposes. If hasPayload is true,
 * then one of the response types will be non-null. Else, both non-error response types
 * will have a type of "null"/*  w ww. j a  v a2  s  . c o  m*/
 */
public static ImmutableList<Ds3ResponseCode> createTestResponseCodes(final boolean hasPayload) {
    final ImmutableList.Builder<Ds3ResponseCode> builder = ImmutableList.builder();

    if (hasPayload) {
        builder.add(new Ds3ResponseCode(200, ImmutableList
                .of(new Ds3ResponseType("com.spectralogic.s3.server.domain.JobWithChunksApiBean", null))));
    } else {
        builder.add(new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("null", null))));
    }

    builder.add(new Ds3ResponseCode(204, ImmutableList.of(new Ds3ResponseType("null", null))));

    builder.add(new Ds3ResponseCode(404, ImmutableList
            .of(new Ds3ResponseType("com.spectralogic.s3.server.domain.HttpErrorResultApiBean", null))));

    return builder.build();
}

From source file:com.yahoo.yqlplus.engine.sources.MethodTracingSource.java

@Query
public List<Person> scan(@Trace("MINE") Tracer trace) throws InterruptedException {
    Thread.sleep(5);/*from   www .ja  v a  2s  .  c o m*/
    trace.fine("Done scanning");
    trace.end();
    return ImmutableList.of(new Person("1", "joe", 0));
}

From source file:com.querydsl.core.types.template.EnumTemplate.java

public static <T extends Enum<T>> EnumExpression<T> create(Class<T> type, String template, Object one) {
    return new EnumTemplate<T>(type, TemplateFactory.DEFAULT.create(template), ImmutableList.of(one));
}