List of usage examples for com.google.common.collect ImmutableList of
public static <E> ImmutableList<E> of(E element)
From source file:org.sonar.plugins.csharp.CSharpMsBuildIntegrationProvider.java
public static List extensions() { return ImmutableList .of(PropertyDefinition.builder("sonar.cs.msbuild.testProjectPattern").name("Test project pattern") .description("Regular expression matched by test project files path (.NET syntax)") .defaultValue("[^\\\\]*test[^\\\\]*$").category(CATEGORY).onQualifiers(Qualifiers.PROJECT) .type(PropertyType.STRING).build()); }
From source file:com.facebook.buck.testutil.RuleMap.java
public static DependencyGraph createGraphFromSingleRule(BuildRule buildRule) { return createGraphFromBuildRules(ImmutableList.of(buildRule)); }
From source file:gobblin.data.management.copy.SinglePartitionCopyableDataset.java
public static Collection<Partition<CopyableFile>> singlePartition(Collection<? extends CopyableFile> files, String name) {//from ww w . j a v a 2 s . c om List<CopyableFile> copyableFiles = Lists.newArrayListWithCapacity(files.size()); for (CopyableFile file : files) { copyableFiles.add(file); } return ImmutableList.of(new Partition.Builder<CopyableFile>(name).add(copyableFiles).build()); }
From source file:com.spectralogic.ds3autogen.java.test.helpers.Ds3ResponseCodeFixtureTestHelper.java
/** * Creates a populated Ds3ResponseCode with a non-error response code *///from www . j a v a 2 s . c om public static Ds3ResponseCode createPopulatedResponseCode(final String variation) { return new Ds3ResponseCode(200, ImmutableList.of(new Ds3ResponseType("com.spectralogic.Test.Type" + variation, null))); }
From source file:com.spectralogic.ds3autogen.java.utils.ResponseParserGeneratorTestUtil.java
public static Ds3ResponseCode getStringResponseCode() { return new Ds3ResponseCode(201, ImmutableList.of(new Ds3ResponseType("java.lang.String", null))); }
From source file:com.wrmsr.wava.java.lang.tree.JTrees.java
public static JBlock jblockify(JStatement statement) { if (statement instanceof JBlock) { return (JBlock) statement; } else {//from w w w . ja v a 2s . c om return new JBlock(ImmutableList.of(statement)); } }
From source file:org.sonar.python.toolkit.PythonToolkit.java
public static List<Tokenizer> getPythonTokenizers() { return ImmutableList.of( (Tokenizer) new KeywordsTokenizer("<span class=\"k\">", "</span>", PythonKeyword.keywordValues())); }
From source file:org.sonar.plsqlopen.toolkit.PlSqlToolkit.java
public static List<Tokenizer> getPythonTokenizers() { return ImmutableList.of( (Tokenizer) new KeywordsTokenizer("<span class=\"k\">", "</span>", PlSqlKeyword.keywordValues())); }
From source file:net.conquiris.qs.QueryToken.java
/** * Helper method to call the constructor. * @param t Token.// w w w . ja v a2 s.com * @return Constructor argument. */ protected static Iterable<Token> tokens(Token t) { return ImmutableList.of(t); }
From source file:com.mysema.query.util.CollectionUtils.java
public static <T> List<T> add(List<T> list, T element) { final int size = list.size(); if (size == 0) { return ImmutableList.of(element); } else if (list instanceof ImmutableList) { if (size == 1) { final T val = list.get(0); list = Lists.newArrayList(); list.add(val); } else {// w w w .ja v a 2 s . c o m list = Lists.newArrayList(list); } } list.add(element); return list; }