List of usage examples for com.google.common.collect ImmutableList of
public static <E> ImmutableList<E> of(E element)
From source file:tool.Lst.java
public static <T> Iterable<T> cons(T first, Iterable<T> rest) { return Iterables.concat(ImmutableList.of(first), rest); }
From source file:com.palantir.atlasdb.schema.constraints.foreign.Select1Long.java
public static List<TupleOf1<Long>> getKeys(Long param) { return ImmutableList.of(TupleOf1.of(param)); }
From source file:com.palantir.atlasdb.schema.constraints.foreign.Select2Long.java
public static List<TupleOf2<Long, Long>> getKeys(Long param, Long param2) { return ImmutableList.of(TupleOf2.of(param, param2)); }
From source file:com.google.devtools.build.skyframe.WalkableGraphUtils.java
public static Iterable<SkyKey> getDirectDeps(WalkableGraph graph, SkyKey key) throws InterruptedException { return Iterables.getOnlyElement(graph.getDirectDeps(ImmutableList.of(key)).values()); }
From source file:google.registry.rdap.RdapTestHelper.java
static void addTermsOfServiceNotice(ImmutableMap.Builder<String, Object> builder, String linkBase) { builder.put("notices", ImmutableList.of(ImmutableMap.of("title", "RDAP Terms of Service", "description", ImmutableList.of(/* w ww . j ava 2 s . c o m*/ "By querying our Domain Database, you are agreeing to comply with these terms" + " so please read them carefully.", "Any information provided is 'as is' without any guarantee of accuracy.", "Please do not misuse the Domain Database. It is intended solely for" + " query-based access.", "Don't use the Domain Database to allow, enable, or otherwise support the" + " transmission of mass unsolicited, commercial advertising or" + " solicitations.", "Don't access our Domain Database through the use of high volume, automated" + " electronic processes that send queries or data to the systems of any" + " ICANN-accredited registrar.", "You may only use the information contained in the Domain Database for lawful" + " purposes.", "Do not compile, repackage, disseminate, or otherwise use the information" + " contained in the Domain Database in its entirety, or in any substantial" + " portion, without our prior written permission.", "We may retain certain details about queries to our Domain Database for the" + " purposes of detecting and preventing misuse.", "We reserve the right to restrict or deny your access to the database if we" + " suspect that you have failed to comply with these terms.", "We reserve the right to modify this agreement at any time."), "links", ImmutableList.of(ImmutableMap.of("value", linkBase + "help/tos", "rel", "alternate", "href", "https://www.registry.tld/about/rdap/tos.html", "type", "text/html"))))); }
From source file:com.facebook.buck.rules.macros.StringWithMacrosUtils.java
public static StringWithMacros format(String format) { return StringWithMacros.of(ImmutableList.of(Either.ofLeft(format))); }
From source file:io.v.impl.google.namespace.NamespaceTestUtil.java
/** * Starts a new test mount server and attaches it to a new context derived from the * provided context.// ww w. j a v a2 s. co m */ public static VContext withTestMountServer(VContext ctx) throws Exception { ctx = V.withListenSpec(ctx, V.getListenSpec(ctx).withAddress(new ListenSpec.Address("tcp", "localhost:0"))); AccessList acl = new AccessList(ImmutableList.of(new BlessingPattern("...")), ImmutableList.<String>of()); Permissions allowAll = new Permissions(ImmutableMap.of(Constants.READ.getValue(), acl, Constants.WRITE.getValue(), acl, Constants.ADMIN.getValue(), acl)); ctx = MountTableServer.withNewServer(ctx, new MountTableServer.Params() .withPermissions(ImmutableMap.of("test", allowAll)).withStatsPrefix("test")); Namespace n = V.getNamespace(ctx); n.setRoots(ImmutableList.of(V23TestUtil.getServerEndpoint(ctx).name())); return ctx; }
From source file:com.wrmsr.wava.java.lang.tree.expression.JIdent.java
public static JIdent of(JName name) { return new JIdent(new JQualifiedName(ImmutableList.of(name))); }
From source file:com.cloudera.oryx.computation.common.records.Specs.java
public static Integer getFieldId(Spec spec, String value) { List<Integer> fieldIds = getFieldIds(spec, ImmutableList.of(value)); if (fieldIds.isEmpty()) { throw new IllegalArgumentException("Could not find field " + value + " in spec"); }//from www .ja v a 2s. c o m return fieldIds.get(0); }
From source file:com.facebook.buck.event.LogviewFormatter.java
public static Iterable<String> format(Throwable t) { StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw);/* w ww . j av a 2 s . c o m*/ sb.append(sw); return ImmutableList.of(sb.toString()); }