Example usage for com.google.common.collect Lists asList

List of usage examples for com.google.common.collect Lists asList

Introduction

In this page you can find the example usage for com.google.common.collect Lists asList.

Prototype

public static <E> List<E> asList(@Nullable E first, E[] rest) 

Source Link

Document

Returns an unmodifiable list containing the specified first element and backed by the specified array of additional elements.

Usage

From source file:com.google.cloud.pubsub.deprecated.PubSubImpl.java

@Override
public List<String> publish(String topic, Message message, Message... messages) {
    return publish(topic, Lists.asList(message, messages));
}

From source file:com.google.cloud.pubsub.deprecated.PubSubImpl.java

@Override
public ApiFuture<List<String>> publishAsync(String topic, Message message, Message... messages) {
    return publishAsync(topic, Lists.asList(message, messages));
}

From source file:com.b2international.commons.collect.LongSets.java

/**
 * Combines the {@link LongIterator iterator} of the given collections into a single one.
 * @param collection the first collection.
 * @param others the other ones.//from w  w  w .  ja  v a2s  .  com
 * @return the combined iterator.
 */
public static LongIterator iterator(final LongCollection collection, final LongCollection... others) {
    return concat(Iterables.transform(Lists.asList(checkNotNull(collection, "collection"), others),
            new Function<LongCollection, LongIterator>() {
                @Override
                public LongIterator apply(final LongCollection longCollection) {
                    return longCollection.iterator();
                }
            }).iterator());
}

From source file:org.apache.streams.sprinklr.util.SprinklrDataToActivityConverter.java

/**
 * Formats the ID to conform with the Apache Streams activity ID convention
 * @param idparts the parts of the ID to join
 * @return a valid Activity ID in format "id:sprinklr:part1:part2:...partN"
 *//*from   w  ww.  j  a va2s  .  c o m*/
public static String formatId(String... idparts) {
    return Joiner.on(":").join(Lists.asList("id:sprinklr", idparts));
}

From source file:com.google.cloud.pubsub.PubSubImpl.java

@Override
public Future<List<String>> publishAsync(String topic, Message message, Message... messages) {
    return publishAsync(topic, Lists.asList(message, messages));
}

From source file:com.leacox.dagger.servlet.DaggerServletContextListener.java

/**
 * @param urlPattern Any Servlet-style pattern. examples: /*, /html/*, *.html, etc.
 *//*  ww w  .j  a v  a 2  s .co  m*/
protected final FilterDefinitionBuilder filter(String urlPattern, String... morePatterns) {
    return new FilterDefinitionBuilderImpl(Lists.asList(urlPattern, morePatterns), UriPatternType.SERVLET);
}

From source file:com.google.errorprone.fixes.SuggestedFixes.java

/**
 * Returns a {@link Fix} that adds members defined by {@code firstMember} (and optionally {@code
 * otherMembers}) to the end of the class referenced by {@code classTree}.  This method should
 * only be called once per {@link ClassTree} as the suggestions will otherwise collide.
 *//*ww  w  .j a va2s .  c  om*/
public static Fix addMembers(ClassTree classTree, VisitorState state, String firstMember,
        String... otherMembers) {
    checkNotNull(classTree);
    int classEndPosition = state.getEndPosition(classTree);
    StringBuilder stringBuilder = new StringBuilder();
    for (String memberSnippet : Lists.asList(firstMember, otherMembers)) {
        stringBuilder.append("\n\n").append(memberSnippet);
    }
    stringBuilder.append('\n');

    return SuggestedFix.replace(classEndPosition - 1, classEndPosition - 1, stringBuilder.toString());
}

From source file:com.leacox.dagger.servlet.DaggerServletContextListener.java

/**
 * @param regex Any Java-style regular expression.
 *//*from w  w w  .  ja  va2  s  .c  om*/
protected final FilterDefinitionBuilder filterRegex(String regex, String... moreRegexes) {
    return new FilterDefinitionBuilderImpl(Lists.asList(regex, moreRegexes), UriPatternType.REGEX);
}

From source file:org.fenixedu.academic.domain.thesis.Thesis.java

public List<ThesisEvaluationParticipant> getAllParticipants(ThesisParticipationType type,
        ThesisParticipationType... types) {
    List<ThesisParticipationType> values = Lists.asList(type, types);
    return getParticipationsSet().stream().filter(p -> values.contains(p.getType()))
            .collect(Collectors.toList());
}

From source file:com.b2international.commons.collect.LongSets.java

/**
 * Concatenates the given long iterators into a single iterators.
 * @param itr the first iterator./*ww w . j a  va 2  s  .  c  om*/
 * @param others the other ones.
 * @return the concatenated iterators.
 */
public static LongIterator concat(final LongIterator itr, final LongIterator... others) {
    return concat(Lists.asList(checkNotNull(itr, "itr"), others).iterator());
}