List of usage examples for com.google.common.collect ImmutableList of
@SuppressWarnings("unchecked") public static <E> ImmutableList<E> of()
From source file:com.facebook.buck.core.cell.UnknownCellException.java
private static final ImmutableList<String> generateSuggestions(Optional<String> cellName, ImmutableSet<String> validCellNames) { if (!cellName.isPresent()) { return ImmutableList.of(); }/*from www . j a va2s . co m*/ List<String> suggestions = MoreStrings.getSpellingSuggestions(cellName.get(), validCellNames, 2); if (!suggestions.isEmpty()) { return ImmutableList.copyOf(suggestions); } return validCellNames.stream().sorted().collect(ImmutableList.toImmutableList()); }
From source file:com.google.testing.compile.Compiler.java
/** Returns a {@link Compiler} that uses a given {@link JavaCompiler} instance. */ public static Compiler compiler(JavaCompiler javaCompiler) { return new AutoValue_Compiler(javaCompiler, ImmutableList.of(), ImmutableList.of()); }
From source file:com.spotify.heroic.suggest.KeySuggest.java
public static KeySuggest of(final List<Suggestion> suggestions) { return new KeySuggest(ImmutableList.of(), suggestions); }
From source file:com.google.idea.blaze.java.run.producers.BlazeJUnitTestFilterFlags.java
/** * Builds the JUnit test filter corresponding to the given class.<br> * Returns null if no class name can be found. *///from w w w .ja va 2 s. c om @Nullable public static String testFilterForClass(PsiClass psiClass) { return testFilterForClassAndMethods(psiClass, ImmutableList.of()); }
From source file:com.isotrol.impe3.freemarker.wrap.ModelUtils.java
static Iterable<String> notNullArgs(List<String> args) { if (args == null) { return ImmutableList.of(); }//from w w w.ja v a 2 s . c o m return filter(args, notNull()); }
From source file:com.linagora.james.mailets.json.Emailers.java
public static List<Emailer> from(Address[] addresses) { return Optional.ofNullable(addresses).map(Emailers::transformAddresses).orElse(ImmutableList.of()); }
From source file:buildcraft.core.tile.TileMarkerPath.java
@Override public ImmutableList<BlockPos> getPath() { PathConnection connection = getCurrentConnection(); if (connection == null) { return ImmutableList.of(); }//w w w . j a v a 2s .c o m return connection.getMarkerPositions(); }
From source file:ro.cosu.vampires.server.actors.messages.configuration.QueryConfiguration.java
public static QueryConfiguration all(User user) { return new AutoValue_QueryConfiguration(ImmutableList.of(), user); }
From source file:com.spotify.heroic.ingestion.Ingestion.java
public static Ingestion of(final List<Long> times) { return new Ingestion(ImmutableList.of(), times); }
From source file:com.spotify.heroic.suggest.TagValuesSuggest.java
public static TagValuesSuggest of(List<Suggestion> suggestions, boolean limited) { return new TagValuesSuggest(ImmutableList.of(), suggestions, limited); }