io.vertx.reactivex.core.MultiMap.getAll()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中io.vertx.reactivex.core.MultiMap.getAll()方法的一些代码示例,展示了MultiMap.getAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.getAll()方法的具体详情如下:
包路径:io.vertx.reactivex.core.MultiMap
类名称:MultiMap
方法名:getAll

MultiMap.getAll介绍

暂无

代码示例

代码示例来源:origin: io.knotx/knotx-core

/**
  * toString() implementation for MultiMap object
  *
  * @param multiMap - {@link MultiMap}
  * @return String representing given MultiMap
  */
 public static String toString(MultiMap multiMap) {
  StringBuilder result = new StringBuilder();
  multiMap.names().stream().forEach(
    name -> result.append(name).append(":").append(Joiner.on(";").join(multiMap.getAll(name)))
      .append("|")
  );

  return result.toString();
 }
}

代码示例来源:origin: Cognifide/knotx

/**
  * toString() implementation for MultiMap object
  *
  * @param multiMap - {@link MultiMap}
  * @return String representing given MultiMap
  */
 public static String toString(MultiMap multiMap) {
  StringBuilder result = new StringBuilder();
  multiMap.names().stream().forEach(
    name -> result.append(name).append(":").append(Joiner.on(";").join(multiMap.getAll(name)))
      .append("|")
  );

  return result.toString();
 }
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(HttpServerResponse response, MultiMap headers) {
 headers.names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       headers
         .getAll(name)
         .forEach(value -> response.putHeader(name, value))
   );
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(HttpServerResponse response, MultiMap headers) {
 headers.names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       headers
         .getAll(name)
         .forEach(value -> response.putHeader(name, value))
   );
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(HttpServerResponse response, MultiMap headers) {
 headers.names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       headers
         .getAll(name)
         .forEach(value -> response.putHeader(name, value))
   );
}

代码示例来源:origin: io.knotx/knotx-core

/**
 * Equality operator for MultiMap objects.
 * MultiMap represents keys as String, values as List of Strings.
 *
 * @param self - compared {@link MultiMap} object self
 * @param that - compared {@link MultiMap} object that
 * @return - true if objects are equals, false otherwise
 */
public static boolean equalsMultiMap(MultiMap self, MultiMap that) {
 return Objects.equal(self.names(), that.names()) &&
   self.names().stream()
     .allMatch(name -> that.contains(name) && self.getAll(name).equals(that.getAll(name)));
}

代码示例来源:origin: Cognifide/knotx

/**
 * Equality operator for MultiMap objects.
 * MultiMap represents keys as String, values as List of Strings.
 *
 * @param self - compared {@link MultiMap} object self
 * @param that - compared {@link MultiMap} object that
 * @return - true if objects are equals, false otherwise
 */
public static boolean equalsMultiMap(MultiMap self, MultiMap that) {
 return Objects.equal(self.names(), that.names()) &&
   self.names().stream()
     .allMatch(name -> that.contains(name) && self.getAll(name).equals(that.getAll(name)));
}

代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: io.gravitee.am.gateway.handlers/gravitee-am-gateway-handler

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: gravitee-io/graviteeio-access-management

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: gravitee-io/graviteeio-access-management

private void parseRequestParameters(RoutingContext context) {
  // invalid_request if the request is missing a required parameter, includes an
  // invalid parameter value, includes a parameter more than once, or is otherwise malformed.
  MultiMap requestParameters = context.request().params();
  Set<String> requestParametersNames = requestParameters.names();
  requestParametersNames.forEach(requestParameterName -> {
    List<String> requestParameterValue = requestParameters.getAll(requestParameterName);
    if (requestParameterValue.size() > 1) {
      throw new InvalidRequestException("Parameter [" + requestParameterName + "] is included more than once");
    }
  });
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx.acme/acme-forms-adapter-http

private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest,
  HttpFormsSettings serviceMetadata) {
 MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(),
   serviceMetadata.getAllowedRequestHeadersPatterns());
 filteredHeaders.names().forEach(
   headerName -> filteredHeaders.getAll(headerName)
     .forEach(value -> request.headers().add(headerName, value)));
 if (customHttpHeader != null) {
  request.headers().set(
    customHttpHeader.getName(),
    customHttpHeader.getValue()
  );
 }
}

代码示例来源:origin: io.knotx/knotx-databridge-adapter-http

private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest,
                 HttpDataSourceSettings serviceMetadata) {
 MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(),
   serviceMetadata.getAllowedRequestHeadersPatterns());
 filteredHeaders.names().forEach(
   headerName -> filteredHeaders.getAll(headerName)
     .forEach(value -> request.headers().add(headerName, value)));
 if (customHttpHeader != null) {
  request.headers().set(
    customHttpHeader.getName(),
    customHttpHeader.getValue()
  );
 }
}

代码示例来源:origin: Cognifide/knotx

private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest,
  ServiceSettings serviceMetadata) {
 MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(),
   serviceMetadata.getAllowedRequestHeadersPatterns());
 filteredHeaders.names().forEach(
   headerName -> filteredHeaders.getAll(headerName)
     .forEach(value -> request.headers().add(headerName, value)));
 if (customHttpHeader != null) {
  request.headers().set(
    customHttpHeader.getName(),
    customHttpHeader.getValue()
  );
 }
}

相关文章