List of usage examples for java.util Collections emptyMap
@SuppressWarnings("unchecked") public static final <K, V> Map<K, V> emptyMap()
From source file:com.sap.prd.mobile.ios.mios.XCodePrepareBuildManager.java
XCodePrepareBuildManager(final ArchiverManager archiverManager, final RepositorySystemSession repoSystemSession, final RepositorySystem repoSystem, final List<RemoteRepository> projectRepos, final boolean useSymbolicLinks, final Map<String, String> additionalPackagingTypes) { this.archiverManager = archiverManager; this.downloadManager = new XCodeDownloadManager(projectRepos, repoSystem, repoSystemSession); this.useSymbolicLinks = useSymbolicLinks; if (additionalPackagingTypes == null) { this.additionalPackagingTypes = Collections.emptyMap(); } else {// ww w . ja va 2 s .c o m this.additionalPackagingTypes = additionalPackagingTypes; } }
From source file:com.domingosuarez.boot.autoconfigure.jade4j.Jade4JAutoConfigurationTests.java
@Test public void shouldRenderTemplateAsExpected() throws Exception { EnvironmentTestUtils.addEnvironment(this.context, "spring.jade4j.mode:XHTML"); this.context.register(Jade4JAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class); this.context.refresh(); JadeConfiguration engine = this.context.getBean(JadeConfiguration.class); JadeTemplate template = engine.getTemplate("demo.jade"); Map<String, Object> params = Collections.emptyMap(); String result = engine.renderTemplate(template, params); String expected = "<html><head><title>Jade</title></head><body><h1>Jade - Template engine</h1></body></html>"; assertEquals(expected, result);/*from w ww . ja v a 2s . c om*/ }
From source file:com.googlecode.jmxtrans.model.output.kafka.KafkaWriter2.java
@VisibleForTesting KafkaWriter2(@Nonnull ObjectMapper objectMapper, Producer<String, String> producer, @Nonnull String topic, @Nonnull ResultSerializer resultSerializer) { this.objectMapper = objectMapper; this.producerConfig = Collections.emptyMap(); this.topic = topic; this.resultSerializer = resultSerializer; this.producer = producer; }
From source file:fr.gael.dhus.util.functional.collect.SortedMapTest.java
/** Constructor: Empty map param. */ @Test//from w w w. j a va 2s . co m public void emptyMapTest() { SortedMap sorted_map = new SortedMap(Collections.emptyMap(), cmp); Assert.assertTrue(sorted_map.isEmpty()); Assert.assertEquals(sorted_map.size(), 0); Assert.assertFalse(sorted_map.keySet().iterator().hasNext()); Assert.assertFalse(sorted_map.values().iterator().hasNext()); Assert.assertFalse(sorted_map.entrySet().iterator().hasNext()); }
From source file:com.hurence.logisland.connect.fake.FakeConnector.java
@Override public List<Map<String, String>> taskConfigs(int maxTasks) { List<Map<String, String>> ret = new ArrayList<>(); for (int i = 0; i < maxTasks; i++) { ret.add(Collections.emptyMap()); }/*from www . jav a2 s . c o m*/ return ret; }
From source file:net.sourceforge.vulcan.jabber.JdbcScreenNameMapperTest.java
public void testHandlesNamingException() throws Exception { namingException = new NamingException(); assertEquals(Collections.emptyMap(), mapper.lookupByAuthor(makeAuthorList("Sam", "Tara"))); }
From source file:org.apache.metamodel.elasticsearch.rest.ElasticSearchRestClient.java
private static Request getMappings(final String indexName) { return new Request(HttpGet.METHOD_NAME, "/" + indexName, Collections.emptyMap(), null); }
From source file:com.thinkbiganalytics.config.rest.controller.ConfigurationController.java
/** * Get the configuration information/*from ww w. j a v a2s.c o m*/ * * @return A map of name value key pairs */ @GET @Path("/properties") @Produces(MediaType.APPLICATION_JSON) @ApiOperation("Gets the current Kylo configuration.") @ApiResponses({ @ApiResponse(code = 200, message = "Returns the configuration parameters.", response = Map.class) }) public Response getConfiguration() { final Map<String, Object> properties; if ((request.getRemoteAddr().equals("127.0.0.1") || request.getRemoteAddr().equals("0:0:0:0:0:0:0:1")) && env instanceof AbstractEnvironment) { properties = StreamSupport.stream(((AbstractEnvironment) env).getPropertySources().spliterator(), false) .filter(source -> source instanceof PropertiesPropertySource) .flatMap(source -> ((PropertiesPropertySource) source).getSource().entrySet().stream()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (value1, value2) -> value1)); } else { properties = Collections.emptyMap(); } return Response.ok(properties).build(); }
From source file:com.sunchenbin.store.feilong.core.net.ParamUtil.java
/** * To array value map.//from w w w. ja va2 s . co m * * <p style="color:green"> * {@link TreeMap},key? * </p> * * @param singleValueMap * the name and value map * @return {@link TreeMap} * @since 1.4.0 */ public static Map<String, String[]> toArrayValueMap(Map<String, String> singleValueMap) { if (Validator.isNullOrEmpty(singleValueMap)) { return Collections.emptyMap(); } Map<String, String[]> arrayValueMap = new TreeMap<String, String[]>();// TreeMap log for (Map.Entry<String, String> entry : singleValueMap.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); arrayValueMap.put(key, new String[] { value }); } return arrayValueMap; }
From source file:edu.cornell.mannlib.vitro.webapp.controller.freemarker.NavigationController.java
private Map<String, Object> getValuesFromRequest() { // TODO: figure out how to get request for FreeMarkerHttpServlet. return Collections.emptyMap(); }