List of usage examples for com.google.common.collect ImmutableListMultimap of
public static <K, V> ImmutableListMultimap<K, V> of(K k1, V v1)
From source file:de.metas.ui.web.window.datatypes.LookupValuesList.java
public static final LookupValuesList fromNullable(final LookupValue lookupValue) { if (lookupValue == null) { return EMPTY; }/*from w w w . j a v a2 s.c om*/ final ImmutableListMultimap<Object, LookupValue> valuesById = ImmutableListMultimap.of(lookupValue.getId(), lookupValue); final Map<String, String> debugProperties = ImmutableMap.of(); return new LookupValuesList(valuesById, debugProperties); }
From source file:org.n52.iceland.util.http.MediaType.java
/** * Constructs a <code>type/subtype;parameter="name"</code> media type. * * @param type// w w w .j a v a2s . c o m * the type (may be <code>null</code> for a wild card) * @param subtype * the subtype (may be <code>null</code> for a wild card) * @param parameter * the parameter * @param parameterValue * the parameter value */ public MediaType(String type, String subtype, String parameter, String parameterValue) { this(type, subtype, ImmutableListMultimap.of(checkNotNull(parameter).toLowerCase(), checkNotNull(parameterValue))); }
From source file:io.wcm.caravan.pipeline.impl.JsonPipelineFactoryImpl.java
@Override public JsonPipeline createEmpty(Map<String, String> contextProperties) { CaravanHttpRequest dummyRequest = new CaravanHttpRequestBuilder("").build(); // make sure to set a Cache-Control header to mark the empty response as indefinitely cacheable, // otherwise the default max-age value of zero would become effective ImmutableListMultimap<String, String> headers = ImmutableListMultimap.of("Cache-Control", "max-age=" + Long.toString(TimeUnit.DAYS.toSeconds(365))); CaravanHttpResponse emptyJsonResponse = new CaravanHttpResponseBuilder().status(200).reason("OK") .headers(headers).body("{}", Charset.forName("UTF-8")).build(); return new JsonPipelineImpl(dummyRequest, Observable.just(emptyJsonResponse), new JsonPipelineContextImpl( this, createMultiLayerCacheAdapter(), metricRegistry, contextProperties)); }