本文整理汇总了Java中io.vertx.core.MultiMap.entries方法的典型用法代码示例。如果您正苦于以下问题:Java MultiMap.entries方法的具体用法?Java MultiMap.entries怎么用?Java MultiMap.entries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.vertx.core.MultiMap
的用法示例。
在下文中一共展示了MultiMap.entries方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getQueryParameters
import io.vertx.core.MultiMap; //导入方法依赖的package包/类
/**
* Return the query parameters which do not include the the first & or ? character.
*
* @return Query string
*/
default String getQueryParameters() {
StringBuilder query = new StringBuilder();
MultiMap params = getParameters();
for (Entry<String, String> entry : params.entries()) {
String value = entry.getValue();
if (value != null) {
if (query.length() != 0) {
query.append("&");
}
// try {
query.append(entry.getKey() + "=" + value);// URLEncoder.encode(value, "UTF-8"));
// } catch (UnsupportedEncodingException e) {
// }
}
}
return query.toString();
}
示例2: addAll
import io.vertx.core.MultiMap; //导入方法依赖的package包/类
@Override
public MultiMap addAll(MultiMap headers) {
for (Map.Entry<String, String> entry : headers.entries()) {
add(entry.getKey(), entry.getValue());
}
return this;
}
示例3: mapParams
import io.vertx.core.MultiMap; //导入方法依赖的package包/类
public static void mapParams(RoutingContext routingContext, Object pojo) {
MultiMap params = routingContext.request().params();
for (Map.Entry<String, String> queryParam : params.entries()) {
if (enumConverterUtilsBean.getPropertyUtils().isWriteable(pojo, queryParam.getKey())) {
try {
enumConverterUtilsBean.setProperty(pojo, queryParam.getKey(), queryParam.getValue());
} catch (IllegalAccessException | InvocationTargetException e) {
throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Could not process query param [" + queryParam.getKey() + "]");
}
}
}
}
示例4: passOkapiTraceHeaders
import io.vertx.core.MultiMap; //导入方法依赖的package包/类
/**
* Pass the response headers from an OkapiClient into the response of this
* request. Only X-Something headers.
*
* @param ok OkapiClient to take resp headers from
*/
public void passOkapiTraceHeaders(OkapiClient ok) {
MultiMap respH = ok.getRespHeaders();
for (Map.Entry<String, String> e : respH.entries()) {
if (XOkapiHeaders.TRACE.equals(e.getKey())
|| "X-Tenant-Perms-Result".equals(e.getKey())) {
ctx.response().headers().add(e.getKey(), e.getValue());
}
}
}
示例5: printToConsole
import io.vertx.core.MultiMap; //导入方法依赖的package包/类
public static void printToConsole(String msg_type, MultiMap mp, Boolean debug) {
if(debug) {
for (Map.Entry entry : mp.entries()) {
System.out.println( msg_type + ": The MultiMap KEY:VALUE pairs for HEADER is: [" + entry.getKey() + ":" +
entry.getValue() +"]");
}
}
}