本文整理了Java中io.vertx.reactivex.core.MultiMap.getDelegate()
方法的一些代码示例,展示了MultiMap.getDelegate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.getDelegate()
方法的具体详情如下:
包路径:io.vertx.reactivex.core.MultiMap
类名称:MultiMap
方法名:getDelegate
暂无
代码示例来源:origin: io.knotx/knotx-core
/**
* Method computing hashCode of the give MultiMap.
* MultiMap is treated as a list of key-value pairs where each key is a String and
* the corresponding value is a List of Strings.
*
* @param multiMap - object to compute hashcode from
* @return - hashcode of the given {@link MultiMap} object
*/
public static int multiMapHash(MultiMap multiMap) {
return multiMap.getDelegate().entries().stream().mapToInt(
entry -> 31 * entry.getKey().hashCode() + (entry.getValue() == null ? 0
: entry.getValue().hashCode())
).reduce(0, (sum, hash) -> 41 * sum + hash);
}
代码示例来源:origin: Cognifide/knotx
/**
* Method computing hashCode of the give MultiMap.
* MultiMap is treated as a list of key-value pairs where each key is a String and
* the corresponding value is a List of Strings.
*
* @param multiMap - object to compute hashcode from
* @return - hashcode of the given {@link MultiMap} object
*/
public static int multiMapHash(MultiMap multiMap) {
return multiMap.getDelegate().entries().stream().mapToInt(
entry -> 31 * entry.getKey().hashCode() + (entry.getValue() == null ? 0
: entry.getValue().hashCode())
).reduce(0, (sum, hash) -> 41 * sum + hash);
}
代码示例来源:origin: gravitee-io/graviteeio-access-management
private MultiValueMap<String, String> extractAdditionalParameters(HttpServerRequest request) {
final Set<String> restrictedParameters = Stream.concat(Stream.of(Parameters.values()).map(p -> p.value()),
Stream.of(io.gravitee.am.common.oidc.Parameters.values()).map(p -> p.value())).collect(Collectors.toSet());
MultiValueMap<String, String> additionalParameters = new LinkedMultiValueMap<>();
request.params().getDelegate().entries().stream().filter(entry -> !restrictedParameters.contains(entry.getKey())).forEach(entry -> additionalParameters.add(entry.getKey(), entry.getValue()));
return additionalParameters;
}
}
代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler
private MultiValueMap<String, String> extractAdditionalParameters(HttpServerRequest request) {
final Set<String> restrictedParameters = Stream.concat(Stream.of(Parameters.values()).map(p -> p.value()),
Stream.of(io.gravitee.am.common.oidc.Parameters.values()).map(p -> p.value())).collect(Collectors.toSet());
MultiValueMap<String, String> additionalParameters = new LinkedMultiValueMap<>();
request.params().getDelegate().entries().stream().filter(entry -> !restrictedParameters.contains(entry.getKey())).forEach(entry -> additionalParameters.add(entry.getKey(), entry.getValue()));
return additionalParameters;
}
}
代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler
private MultiValueMap<String, String> extractAdditionalParameters(HttpServerRequest request) {
final Set<String> restrictedParameters = Stream.concat(Stream.of(Parameters.values()).map(p -> p.value()),
Stream.of(io.gravitee.am.common.oidc.Parameters.values()).map(p -> p.value())).collect(Collectors.toSet());
MultiValueMap<String, String> additionalParameters = new LinkedMultiValueMap<>();
request.params().getDelegate().entries().stream().filter(entry -> !restrictedParameters.contains(entry.getKey())).forEach(entry -> additionalParameters.add(entry.getKey(), entry.getValue()));
return additionalParameters;
}
}
代码示例来源:origin: gravitee-io/graviteeio-access-management
private MultiValueMap<String, String> extractAdditionalParameters(HttpServerRequest request) {
final Set<String> restrictedParameters = Stream.concat(Stream.of(Parameters.values()).map(p -> p.value()),
Stream.of(io.gravitee.am.common.oidc.Parameters.values()).map(p -> p.value())).collect(Collectors.toSet());
MultiValueMap<String, String> additionalParameters = new LinkedMultiValueMap<>();
request.params().getDelegate().entries().stream().filter(entry -> !restrictedParameters.contains(entry.getKey())).forEach(entry -> additionalParameters.add(entry.getKey(), entry.getValue()));
return additionalParameters;
}
}
代码示例来源:origin: io.knotx/knotx-databridge-adapter-http
public static String encodeBody(final MultiMap formAttributes, Charset charset) {
if (formAttributes == null || formAttributes.isEmpty()) {
return StringUtils.EMPTY;
} else {
Iterator<Entry<String, String>> entryIt = formAttributes
.getDelegate()
.iterator();
StringBuilder sb = new StringBuilder(128);
while (entryIt.hasNext()) {
Entry<String, String> entry = entryIt.next();
sb.append(encodeComponent(entry.getKey(), charset));
if (entry.getValue() != null) {
sb.append('=');
sb.append(encodeComponent(entry.getValue(), charset));
}
if (entryIt.hasNext()) {
sb.append('&');
}
}
return sb.toString();
}
}
代码示例来源:origin: Cognifide/knotx
public static String encodeBody(final MultiMap formAttributes, Charset charset) {
if (formAttributes == null || formAttributes.isEmpty()) {
return StringUtils.EMPTY;
} else {
Iterator<Entry<String, String>> entryIt = formAttributes
.getDelegate()
.iterator();
StringBuilder sb = new StringBuilder(128);
while (entryIt.hasNext()) {
Entry<String, String> entry = entryIt.next();
sb.append(encodeComponent(entry.getKey(), charset));
if (entry.getValue() != null) {
sb.append('=');
sb.append(encodeComponent(entry.getValue(), charset));
}
if (entryIt.hasNext()) {
sb.append('&');
}
}
return sb.toString();
}
}
代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler
private MultiValueMap<String, String> extractRequestParameters(HttpServerRequest request) {
MultiValueMap<String, String> requestParameters = new LinkedMultiValueMap<>(request.params().size());
request.params().getDelegate().entries().forEach(entry -> requestParameters.add(entry.getKey(), entry.getValue()));
return requestParameters;
}
代码示例来源:origin: io.knotx/knotx-core
/**
* Converts MultiMap to JsonObject<br> It expects the MultiMap key, contains List of String
* objects, so the result of conversion will look like below
* <br>
* <pre>
* {
* "mapKey1": ["val1", "val2"],
* "mapKey2": ["val1"]
* }
* </pre>
*
* @param multiMap - {@link MultiMap} to convert
* @return - {@link JsonObject} with {@link JsonArray} under each object key
*/
public static JsonObject toJsonObject(MultiMap multiMap) {
JsonObject json = new JsonObject();
multiMap.getDelegate().forEach(
entry -> {
JsonArray values;
if (json.containsKey(entry.getKey())) {
values = json.getJsonArray(entry.getKey());
} else {
values = new JsonArray();
json.put(entry.getKey(), values);
}
values.add(entry.getValue());
}
);
return json;
}
代码示例来源:origin: Cognifide/knotx
/**
* Converts MultiMap to JsonObject<br> It expects the MultiMap key, contains List of String
* objects, so the result of conversion will look like below
* <br>
* <pre>
* {
* "mapKey1": ["val1", "val2"],
* "mapKey2": ["val1"]
* }
* </pre>
*
* @param multiMap - {@link MultiMap} to convert
* @return - {@link JsonObject} with {@link JsonArray} under each object key
*/
public static JsonObject toJsonObject(MultiMap multiMap) {
JsonObject json = new JsonObject();
multiMap.getDelegate().forEach(
entry -> {
JsonArray values;
if (json.containsKey(entry.getKey())) {
values = json.getJsonArray(entry.getKey());
} else {
values = new JsonArray();
json.put(entry.getKey(), values);
}
values.add(entry.getValue());
}
);
return json;
}
代码示例来源:origin: gravitee-io/graviteeio-access-management
private MultiValueMap<String, String> extractRequestParameters(HttpServerRequest request) {
MultiValueMap<String, String> requestParameters = new LinkedMultiValueMap<>(request.params().size());
request.params().getDelegate().entries().forEach(entry -> requestParameters.add(entry.getKey(), entry.getValue()));
return requestParameters;
}
代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler
private MultiValueMap<String, String> extractRequestParameters(HttpServerRequest request) {
MultiValueMap<String, String> requestParameters = new LinkedMultiValueMap<>(request.params().size());
request.params().getDelegate().entries().forEach(entry -> requestParameters.add(entry.getKey(), entry.getValue()));
return requestParameters;
}
代码示例来源:origin: gravitee-io/graviteeio-access-management
private MultiValueMap<String, String> extractRequestParameters(HttpServerRequest request) {
MultiValueMap<String, String> requestParameters = new LinkedMultiValueMap<>(request.params().size());
request.params().getDelegate().entries().forEach(entry -> requestParameters.add(entry.getKey(), entry.getValue()));
return requestParameters;
}
代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler
Map<String, String> approvalParameters = params.getDelegate().entries()
.stream()
.filter(entry -> entry.getKey().startsWith(OAuth2Constants.SCOPE_PREFIX))
代码示例来源:origin: gravitee-io/graviteeio-access-management
Map<String, String> approvalParameters = params.getDelegate().entries()
.stream()
.filter(entry -> entry.getKey().startsWith(OAuth2Constants.SCOPE_PREFIX))
内容来源于网络,如有侵权,请联系作者删除!