本文整理了Java中java.util.Map.of()
方法的一些代码示例,展示了Map.of()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Map.of()
方法的具体详情如下:
包路径:java.util.Map
类名称:Map
方法名:of
暂无
代码示例来源:origin: br.com.jarch/jarch-bpmn
public static List<TaskBean> filterTaskCandidateGroup(List<String> processDefinitionKey, List<String> candidateGroups) {
return filterTask(processDefinitionKey,
Map.of(CANDIDATE_GROUPS, candidateGroups.stream().collect(Collectors.joining(","))));
}
代码示例来源:origin: hank-whu/turbo-rpc
/**
* 注册invoker
*
* @param service
* 实现类实例,重复调用时不会覆盖,会一直使用首次注册的实例
*
* @param clazz
* 服务接口
*
*/
public synchronized void register(Class<?> clazz, Object service) {
register(Map.of(clazz, service));
}
代码示例来源:origin: br.com.jarch/jarch-bpmn
public static List<TaskBean> filterTaskCandidateGroup(List<String> processDefinitionKey, List<String> candidateGroups, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterTask(processDefinitionKey,
Map.of(
// ASSIGNEE, CDI.current().select(UserInformation.class).get().get().getId().toString(),
PROCESS_VARIABLES, processVariables,
CANDIDATE_GROUP, candidateGroups.stream().collect(Collectors.joining(","))
));
}
代码示例来源:origin: br.com.jarch/jarch-bpm
public static List<TaskBean> filterTaskCandidateGroup(List<String> processDefinitionKey, List<String> candidateGroups, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterTask(processDefinitionKey,
Map.of(
// ASSIGNEE, CDI.current().select(UserInformation.class).get().get().getId().toString(),
PROCESS_VARIABLES, processVariables,
CANDIDATE_GROUP, candidateGroups.stream().collect(Collectors.joining(","))
));
}
代码示例来源:origin: net.dongliu/xhttp
@Override
public Map<String, List<String>> get(URI uri, Map<String, List<String>> requestHeaders) throws IOException {
var headers = super.get(uri, requestHeaders);
var userList = requestHeaders.getOrDefault(HeaderNames.COOKIE, List.of());
var sessionList = headers.getOrDefault(HeaderNames.COOKIE, List.of());
var cookieValues = Lists.concat(userList, sessionList);
if (cookieValues.isEmpty()) {
return Map.of();
}
return Map.of(HeaderNames.COOKIE, cookieValues);
}
}
代码示例来源:origin: com.javax0.geci/javageci-tools
private static CompoundParams getParameters(String generatorMnemonic, String string) {
if (string.startsWith(generatorMnemonic + " ")) {
var parametersString = string.substring(generatorMnemonic.length() + 1);
return new CompoundParams(generatorMnemonic, Map.copyOf(getParameters(parametersString)));
} else if (string.equals(generatorMnemonic)) {
return new CompoundParams(generatorMnemonic, Map.of());
} else {
return null;
}
}
代码示例来源:origin: com.github.javaito/hcjf
private static Collection<JoinableMap> getReadableLayers() {
Collection<JoinableMap> result = new ArrayList<>();
for(ReadRowsLayerInterface layer : getAll(ReadRowsLayerInterface.class, (L)->true)) {
result.add(new JoinableMap(Map.of("name", layer.getImplName())));
}
return result;
}
代码示例来源:origin: com.yahoo.vespa/vespaclient-container-plugin
public void reportHttpRequest(String clientVersion) {
if (clientVersion != null) {
try {
Point point = versionPointCache.get(clientVersion, () -> new Point(Map.of("client-version", clientVersion)));
feedRequests.add(point);
} catch (ExecutionException e) { // When Point constructor throws an exception
throw new RuntimeException(e);
}
} else {
feedRequests.add();
}
}
代码示例来源:origin: br.com.jarch/jarch-bpmn
public static List<TaskBean> filterTaskVariables(String processDefinitionKey, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterTask(processDefinitionKey, Map.of(PROCESS_VARIABLES, processVariables));
}
代码示例来源:origin: br.com.jarch/jarch-bpm
public static List<TaskBean> filterTaskVariables(String processDefinitionKey, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterTask(processDefinitionKey, Map.of(PROCESS_VARIABLES, processVariables));
}
代码示例来源:origin: br.com.jarch/jarch-bpm
public static List<ProcessInstanceBean> filterProcessInstance(List<String> processDefinitionKey, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterProcessInstanceBase(processDefinitionKey, Map.of(VARIABLES, processVariables));
}
代码示例来源:origin: br.com.jarch/jarch-bpmn
public static List<TaskBean> filterTaskAssignee(List<String> processDefinitionKey) {
return filterTask(processDefinitionKey,
Map.of(ASSIGNEE, CDI.current().select(UserInformation.class).get().get().getId().toString()));
}
代码示例来源:origin: br.com.jarch/jarch-bpm
public static List<TaskBean> filterTaskInvolvedUser(List<String> processDefinitionKey) {
return filterTask(processDefinitionKey,
Map.of(INVOLVED_USER, CDI.current().select(UserInformation.class).get().get().getId().toString()));
}
代码示例来源:origin: br.com.jarch/jarch-bpmn
public static List<TaskBean> filterTaskCandidateUser(List<String> processDefinitionKey) {
return filterTask(processDefinitionKey,
Map.of(CANDIDATE_USER, CDI.current().select(UserInformation.class).get().get().getId().toString()));
}
代码示例来源:origin: br.com.jarch/jarch-bpmn
public static List<ProcessInstanceBean> filterProcessInstance(String processDefinitionKey, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterProcessInstanceBase(List.of(processDefinitionKey), Map.of(VARIABLES, processVariables));
}
代码示例来源:origin: br.com.jarch/jarch-bpm
public static List<ProcessInstanceBean> filterProcessInstance(String processDefinitionKey, Map<String, Object> variablesEquals) {
String processVariables = getVariablesPathEquals(variablesEquals);
return filterProcessInstanceBase(List.of(processDefinitionKey), Map.of(VARIABLES, processVariables));
}
代码示例来源:origin: no.ssb.lds/linked-data-store-persistence-provider-test
public static TestSpecificationElement booleanNode(String name) {
return new TestSpecificationElement(name, SpecificationElementType.EMBEDDED, Set.of("boolean"), List.of(), Set.of(), Map.of(), null);
}
代码示例来源:origin: no.ssb.lds/linked-data-store-persistence-provider-test
public static TestSpecificationElement numericNode(String name) {
return new TestSpecificationElement(name, SpecificationElementType.EMBEDDED, Set.of("numeric"), List.of(), Set.of(), Map.of(), null);
}
代码示例来源:origin: no.ssb.lds/linked-data-store-persistence-provider-test
public static TestSpecificationElement arrayNode(String name, TestSpecificationElement items) {
TestSpecificationElement arrayNode = new TestSpecificationElement(name, SpecificationElementType.EMBEDDED, Set.of("array"), List.of(), Set.of(), Map.of(), items);
items.parent(arrayNode);
return arrayNode;
}
代码示例来源:origin: elastic/apm-agent-java
@Test
void serializeTags() {
assertSoftly(softly -> {
softly.assertThat(serializeTags(Map.of(".**", "foo.bar"))).isEqualTo(toJson(Map.of("___", "foo.bar")));
softly.assertThat(serializeTags(Map.of("foo.bar", "baz"))).isEqualTo(toJson(Map.of("foo_bar", "baz")));
softly.assertThat(serializeTags(Map.of("foo.bar.baz", "qux"))).isEqualTo(toJson(Map.of("foo_bar_baz", "qux")));
softly.assertThat(serializeTags(Map.of("foo*bar*baz", "qux"))).isEqualTo(toJson(Map.of("foo_bar_baz", "qux")));
softly.assertThat(serializeTags(Map.of("foo\"bar\"baz", "qux"))).isEqualTo(toJson(Map.of("foo_bar_baz", "qux")));
final String longRandomString = RandomStringUtils.randomAlphanumeric(1025);
final String truncatedLongRandomString = longRandomString.substring(0, 1023) + "…";
softly.assertThat(serializeTags(Map.of(longRandomString, longRandomString))).isEqualTo(toJson(Map.of(truncatedLongRandomString, truncatedLongRandomString)));
});
}
内容来源于网络,如有侵权,请联系作者删除!