List of usage examples for com.google.common.collect ImmutableMultimap of
public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1)
From source file:com.github.autermann.wps.Main.java
public static void main(String[] args) throws Exception { new WPS("localhost", 12121) .addAlgorithmRepository(MatlabAlgorithmRepository.class, ImmutableMultimap.of(MatlabAlgorithmRepository.CONFIG_PROPERTY, "/home/auti/Source/Lake-Analyzer/WPS/lakeAnalyzer.yaml")) .addGenerator(MatlabFileHandler.class).addParser(MatlabFileHandler.class).start(); }
From source file:me.lucko.luckperms.api.context.ImmutableContextSet.java
/** * Make a singleton ImmutableContextSet from a context pair * * @param key the key/* w ww .java 2s .com*/ * @param value the value * @return a new ImmutableContextSet containing one KV pair * @throws NullPointerException if key or value is null */ public static ImmutableContextSet singleton(String key, String value) { if (key == null) { throw new NullPointerException("key"); } if (value == null) { throw new NullPointerException("value"); } return new ImmutableContextSet(ImmutableMultimap.of(key.toLowerCase(), value)); }
From source file:co.cask.cdap.logging.gateway.handlers.AbstractJSONCallback.java
@Override protected Multimap<String, String> getResponseHeaders() { return ImmutableMultimap.of(HttpHeaders.Names.CONTENT_TYPE, "application/json"); }
From source file:com.tinspx.util.net.RequestBody.java
public static RequestBody of(ByteSource source, String contentType) { return of(source, ImmutableMultimap.of(HttpHeaders.CONTENT_TYPE, contentType), false); }
From source file:co.cask.cdap.internal.app.runtime.webapp.WebappURLRewriter.java
@Override public boolean rewrite(HttpRequest request, HttpResponder responder) { String hostHeader = HttpHeaders.getHost(request); if (hostHeader == null) { return true; }//www.j a v a 2 s .c o m String originalUri = request.getUri(); String uri = jarHttpHandler.getServePath(hostHeader, originalUri); if (uri != null) { // Redirect requests that map to index.html without a trailing slash to url/ if (!originalUri.endsWith("/") && !originalUri.endsWith("index.html") && uri.endsWith("index.html")) { responder.sendStatus(HttpResponseStatus.MOVED_PERMANENTLY, ImmutableMultimap.of("Location", originalUri + "/")); return false; } request.setUri(uri); } return true; }
From source file:co.cask.cdap.logging.gateway.handlers.TextChunkedLogProducer.java
@Override public Multimap<String, String> getResponseHeaders() { return ImmutableMultimap.of(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=utf-8"); }
From source file:demo.client.local.builtin.FlowPage.java
@PageShowing private void start() { final AppFlow<Unit, ?> flow = getFlow(); executor.execute(flow, output -> transition.go(ImmutableMultimap.of("id", entity))); title.setTextContent(simpleName(entity) + " Flow Page"); }
From source file:org.javersion.store.jdbc.DocumentVersionStoreJdbc.java
public void append(Id docId, VersionNode<PropertyPath, Object, M> version) { options.transactions.writeRequired(() -> { doAppend(ImmutableMultimap.of(docId, version)); return null; });//from w w w.ja v a 2s . co m }
From source file:org.jboss.errai.demo.grocery.client.local.StoresPage.java
@EventHandler("addStoreButton") public void onStoreAddButtonClick(ClickEvent event) { Store newStore = new Store(); em.persist(newStore);//from w w w . j av a 2s .co m toStorePage.go(ImmutableMultimap.of("id", String.valueOf(newStore.getId()))); }
From source file:co.cask.cdap.logging.gateway.handlers.ChunkedLogReaderCallback.java
@Override public void init() { patternLayout.start();/*from ww w . j a va 2 s . c om*/ chunkResponder = responder.sendChunkStart(HttpResponseStatus.OK, ImmutableMultimap.of(HttpHeaders.Names.CONTENT_TYPE, "text/plain; charset=utf-8")); }