List of usage examples for com.google.common.collect ImmutableMap of
public static <K, V> ImmutableMap<K, V> of(K k1, V v1)
From source file:io.druid.cli.convert.IndexCacheConverter.java
@Override public Map<String, String> convert(Properties properties) { final String value = properties.getProperty(PROPERTY); return ImmutableMap.of("druid.segmentCache.locations", String.format( "[{\"path\": \"%s\", \"maxSize\": %s}]", value, properties.getProperty("druid.server.maxSize"))); }
From source file:com.icosilune.fn.nodes.SinkNode.java
@Override public Map<String, Socket> getInputSockets() { return ImmutableMap.of(IN_NAME, Socket.create(IN_NAME, type, Socket.SocketType.INPUT)); }
From source file:io.druid.server.initialization.jetty.TaskIdResponseHeaderFilterHolder.java
public TaskIdResponseHeaderFilterHolder(String path, String taskId) { super(path, taskId == null ? ImmutableMap.<String, String>of() : ImmutableMap.of(ChatHandlerResource.TASK_ID_HEADER, taskId)); }
From source file:com.opengamma.strata.measure.fxopt.FxOptionMarketDataLookup.java
/** * Obtains an instance based on a single mapping from currency pair to volatility identifier. * <p>/*w ww .j a va 2 s .c om*/ * The lookup provides volatilities for the specified currency pair. * * @param currencyPair the currency pair * @param volatilityId the volatility identifier * @return the FX options lookup containing the specified mapping */ public static FxOptionMarketDataLookup of(CurrencyPair currencyPair, FxOptionVolatilitiesId volatilityId) { return DefaultFxOptionMarketDataLookup.of(ImmutableMap.of(currencyPair, volatilityId)); }
From source file:com.opengamma.strata.measure.capfloor.IborCapFloorMarketDataLookup.java
/** * Obtains an instance based on a single mapping from index to volatility identifier. * <p>/*from w w w. j a va 2 s . c o m*/ * The lookup provides volatilities for the specified index. * * @param index the Ibor index * @param volatilityId the volatility identifier * @return the cap/floor lookup containing the specified mapping */ public static IborCapFloorMarketDataLookup of(IborIndex index, IborCapletFloorletVolatilitiesId volatilityId) { return DefaultIborCapFloorMarketDataLookup.of(ImmutableMap.of(index, volatilityId)); }
From source file:org.openqa.selenium.remote.server.handler.DescribeElement.java
@Override public Map<String, String> call() throws Exception { return ImmutableMap.of("ELEMENT", getElementId()); }
From source file:com.proofpoint.tracetoken.TraceTokenManager.java
/** * Associate a given trace token id, with no other properties, with the * current thread./* w w w .j av a 2s . c o m*/ * * @param tokenId The tokenId to associate with the current thread, or null to * remove the thread's token. * @return a {@link TraceTokenScope} which may be used to restore the thread's * previous association. Intended to be used with try-with-resources: * <code> * try (TraceTokenScope ignored = registerRequestToken(traceTokenId)) { * // process request * } * </code> */ public static TraceTokenScope registerRequestToken(@Nullable String tokenId) { if (tokenId == null) { return registerTraceToken(null); } return registerTraceToken(new TraceToken(ImmutableMap.of("id", tokenId))); }
From source file:io.druid.cli.convert.ChatHandlerConverter.java
@Override public Map<String, String> convert(Properties properties) { if (Boolean.parseBoolean(properties.getProperty(PROPERTY))) { return ImmutableMap.of("druid.indexer.task.chathandler.type", "curator"); }//from w w w . j av a 2 s .com return ImmutableMap.of(); }
From source file:org.obm.push.mail.EmailViewTestsUtils.java
public static Map<MSEmailBodyType, EmailView> createPlainTextMap(String string) { return ImmutableMap.of(MSEmailBodyType.PlainText, EmailView.builder().uid(1).bodyMimePartData(new ByteArrayInputStream(string.getBytes())) .bodyType(MSEmailBodyType.PlainText).envelope(Envelope.builder().build()).truncated(false) .charset(Charsets.UTF_8.name()).build()); }
From source file:com.cinchapi.common.describe.Empty.java
/** * Create an {@link Empty} instance with the {@code check} for the specified * {@code clazz}. More definitions can be added using the * {@link #define(Class, Check)} method. * /* www. ja v a 2 s .co m*/ * @param clazz * @param check * @return the {@link Empty} instance */ public static <T> Empty is(Class<T> clazz, Predicate<T> check) { return is(ImmutableMap.of(clazz, check)); }