本文整理汇总了Java中java.util.Collections.emptyMap方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.emptyMap方法的具体用法?Java Collections.emptyMap怎么用?Java Collections.emptyMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Collections
的用法示例。
在下文中一共展示了Collections.emptyMap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadProjectItemsByProjectIds
import java.util.Collections; //导入方法依赖的package包/类
/**
* Loads ProjectItems for a list of specified projectIds
* @param projectIds a List of Ids of projects to load ProjectItems
* @return a Map of ProjectItems to project IDs
*/
@Transactional(propagation = Propagation.MANDATORY)
public Map<Long, Set<ProjectItem>> loadProjectItemsByProjectIds(List<Long> projectIds) {
if (projectIds.isEmpty()) {
return Collections.emptyMap();
}
Long listId = daoHelper.createTempLongList(projectIds);
return loadProjectItemsByList(listId);
}
示例2: testCreateWithInvalidPattern
import java.util.Collections; //导入方法依赖的package包/类
public void testCreateWithInvalidPattern() throws Exception {
GrokProcessor.Factory factory = new GrokProcessor.Factory(Collections.emptyMap());
Map<String, Object> config = new HashMap<>();
config.put("field", "_field");
config.put("patterns", Collections.singletonList("["));
ElasticsearchParseException e = expectThrows(ElasticsearchParseException.class, () -> factory.create(null, null, config));
assertThat(e.getMessage(), equalTo("[patterns] Invalid regex pattern found in: [[]. premature end of char-class"));
}
示例3: execute
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
EventAdmin ea = ServiceUtil.getService(EventAdmin.class);
Event stepOver = new Event(EA_TOPIC_DEBUGGING_ACTION_RESUME, Collections.emptyMap());
ea.sendEvent(stepOver);
// has to be null (see javadoc)
return null;
}
示例4: getCookies
import java.util.Collections; //导入方法依赖的package包/类
private Map<String, String> getCookies(Cookie[] annotationCookies) {
HashMap<String, String> cookies = new HashMap<>();
for (Cookie annotationCookie : annotationCookies) {
if (annotationCookie.name().isEmpty()) {
return Collections.emptyMap();
}
cookies.put(annotationCookie.name(), annotationCookie.value());
}
return cookies;
}
示例5: getHeaders
import java.util.Collections; //导入方法依赖的package包/类
private Map<String, String> getHeaders(Header[] annotationHeaders) {
HashMap<String, String> headers = new HashMap<>();
for (Header annotationHeader : annotationHeaders) {
if (annotationHeader.name().isEmpty()) {
return Collections.emptyMap();
}
headers.put(annotationHeader.name(), annotationHeader.value());
}
return headers;
}
示例6: getAttributesMap
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Map<String, byte[]> getAttributesMap() {
if (attributes == null) {
return Collections.emptyMap();
}
return Collections.unmodifiableMap(attributes);
}
示例7: emptyMapTest
import java.util.Collections; //导入方法依赖的package包/类
/** Constructor: Empty map param. */
@Test
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());
}
示例8: testCustomScriptContextSettings
import java.util.Collections; //导入方法依赖的package包/类
public void testCustomScriptContextSettings() throws Exception {
ScriptService scriptService = makeScriptService();
Script script = new Script(ScriptType.INLINE, MockScriptEngine.NAME, "1", Collections.emptyMap());
try {
scriptService.compile(script, new ScriptContext.Plugin(PLUGIN_NAME, "custom_exp_disabled_op"));
fail("script compilation should have been rejected");
} catch (IllegalStateException e) {
assertTrue(e.getMessage(), e.getMessage().contains("scripts of type [inline], operation [" + PLUGIN_NAME + "_custom_exp_disabled_op] and lang [" + MockScriptEngine.NAME + "] are disabled"));
}
// still works for other script contexts
assertNotNull(scriptService.compile(script, ScriptContext.Standard.AGGS));
assertNotNull(scriptService.compile(script, ScriptContext.Standard.SEARCH));
assertNotNull(scriptService.compile(script, new ScriptContext.Plugin(PLUGIN_NAME, "custom_op")));
}
示例9: TtmlSubtitle
import java.util.Collections; //导入方法依赖的package包/类
public TtmlSubtitle(TtmlNode root, Map<String, TtmlStyle> globalStyles,
Map<String, TtmlRegion> regionMap) {
this.root = root;
this.regionMap = regionMap;
this.globalStyles = globalStyles != null
? Collections.unmodifiableMap(globalStyles) : Collections.<String, TtmlStyle>emptyMap();
this.eventTimesUs = root.getEventTimesUs();
}
示例10: getLastMessageTemplateModel
import java.util.Collections; //导入方法依赖的package包/类
public Map<String, Object> getLastMessageTemplateModel()
{
Object model = parameterValues.get(PARAM_TEMPLATE_MODEL);
if (model instanceof Map)
{
return (Map<String, Object>) model;
}
else
{
String className = model == null ? "" : model.getClass().getName();
LOGGER.warn("Skipping unsupported email template model parameters of type " + className);
}
return Collections.emptyMap();
}
示例11: MapExpression
import java.util.Collections; //导入方法依赖的package包/类
public MapExpression(int lineNumber) {
this.entries = Collections.emptyMap();
this.lineNumber = lineNumber;
}
示例12: getServitors
import java.util.Collections; //导入方法依赖的package包/类
/**
* @return the summon
*/
public Map<Integer, L2Summon> getServitors()
{
return Collections.emptyMap();
}
示例13: getPingsForGuild
import java.util.Collections; //导入方法依赖的package包/类
public Map<Long, List<CustomPing>> getPingsForGuild(IGuild guild) {
if (storage == null) {
return Collections.emptyMap();
}
return storage.get(guild);
}
示例14: getExecutionProperties
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Map<String, String> getExecutionProperties() {
return Collections.emptyMap();
}
示例15: g
import java.util.Collections; //导入方法依赖的package包/类
private g(byte b) {
this.a = Collections.emptyMap();
}