本文整理匯總了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() +"]");
}
}
}