org.springframework.util.MultiValueMap#size ( )源码实例Demo

下面列出了org.springframework.util.MultiValueMap#size ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: spring-analysis-note   文件: UrlPathHelper.java
/**
 * Decode the given matrix variables via {@link #decodeRequestString} unless
 * {@link #setUrlDecode} is set to {@code true} in which case it is assumed
 * the URL path from which the variables were extracted is already decoded
 * through a call to {@link #getLookupPathForRequest(HttpServletRequest)}.
 * @param request current HTTP request
 * @param vars the URI variables extracted from the URL path
 * @return the same Map or a new Map instance
 */
public MultiValueMap<String, String> decodeMatrixVariables(
		HttpServletRequest request, MultiValueMap<String, String> vars) {

	if (this.urlDecode) {
		return vars;
	}
	else {
		MultiValueMap<String, String> decodedVars = new LinkedMultiValueMap<>(vars.size());
		vars.forEach((key, values) -> {
			for (String value : values) {
				decodedVars.add(key, decodeInternal(request, value));
			}
		});
		return decodedVars;
	}
}
 
源代码2 项目: java-technology-stack   文件: UrlPathHelper.java
/**
 * Decode the given matrix variables via
 * {@link #decodeRequestString(HttpServletRequest, String)} unless
 * {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
 * assumed the URL path from which the variables were extracted is already
 * decoded through a call to
 * {@link #getLookupPathForRequest(HttpServletRequest)}.
 * @param request current HTTP request
 * @param vars the URI variables extracted from the URL path
 * @return the same Map or a new Map instance
 */
public MultiValueMap<String, String> decodeMatrixVariables(HttpServletRequest request,
		MultiValueMap<String, String> vars) {

	if (this.urlDecode) {
		return vars;
	}
	else {
		MultiValueMap<String, String> decodedVars = new LinkedMultiValueMap<>(vars.size());
		vars.forEach((key, values) -> {
			for (String value : values) {
				decodedVars.add(key, decodeInternal(request, value));
			}
		});
		return decodedVars;
	}
}
 
@Test
public final void testToMultiValueMap() {
	String rsql = "sites.trunks.id==2,id==2,company.id=='2',id==3,name==''";
	MultiValueMap<String, String> map = toMultiValueMap(rsql);
	log.info("MultiValueMap<String,String> map:{}", map);
	long count = map.size();
	log.info("rsql: {} -> count: {}", rsql, count);
	assertThat("MultiValueMap", count, is(4l));
	assertThat("MultiValueMap", map.get("id").size(), is(2));
}
 
源代码4 项目: lams   文件: UrlPathHelper.java
/**
 * Decode the given matrix variables via
 * {@link #decodeRequestString(HttpServletRequest, String)} unless
 * {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
 * assumed the URL path from which the variables were extracted is already
 * decoded through a call to
 * {@link #getLookupPathForRequest(HttpServletRequest)}.
 * @param request current HTTP request
 * @param vars URI variables extracted from the URL path
 * @return the same Map or a new Map instance
 */
public MultiValueMap<String, String> decodeMatrixVariables(HttpServletRequest request, MultiValueMap<String, String> vars) {
	if (this.urlDecode) {
		return vars;
	}
	else {
		MultiValueMap<String, String> decodedVars = new LinkedMultiValueMap	<String, String>(vars.size());
		for (String key : vars.keySet()) {
			for (String value : vars.get(key)) {
				decodedVars.add(key, decodeInternal(request, value));
			}
		}
		return decodedVars;
	}
}
 
源代码5 项目: spring4-understanding   文件: UrlPathHelper.java
/**
 * Decode the given matrix variables via
 * {@link #decodeRequestString(HttpServletRequest, String)} unless
 * {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
 * assumed the URL path from which the variables were extracted is already
 * decoded through a call to
 * {@link #getLookupPathForRequest(HttpServletRequest)}.
 * @param request current HTTP request
 * @param vars URI variables extracted from the URL path
 * @return the same Map or a new Map instance
 */
public MultiValueMap<String, String> decodeMatrixVariables(HttpServletRequest request, MultiValueMap<String, String> vars) {
	if (this.urlDecode) {
		return vars;
	}
	else {
		MultiValueMap<String, String> decodedVars = new LinkedMultiValueMap	<String, String>(vars.size());
		for (String key : vars.keySet()) {
			for (String value : vars.get(key)) {
				decodedVars.add(key, decodeInternal(request, value));
			}
		}
		return decodedVars;
	}
}
 
源代码6 项目: AIDR   文件: SpringSocialUserDetailService.java
private List<Connection<?>> getConnections(ConnectionRepository connectionRepository) {
	MultiValueMap<String, Connection<?>> connections = connectionRepository.findAllConnections();
	List<Connection<?>> allConnections = new ArrayList<Connection<?>>();
	if (connections.size() > 0) {
		for (List<Connection<?>> connectionList : connections.values()) {
			for (Connection<?> connection : connectionList) {
				allConnections.add(connection);
			}
		}
	}
	return allConnections;
}
 
源代码7 项目: AIDR   文件: SpringSocialUserDetailService.java
private List<Connection<?>> getConnections(ConnectionRepository connectionRepository) {
	MultiValueMap<String, Connection<?>> connections = connectionRepository.findAllConnections();
	List<Connection<?>> allConnections = new ArrayList<Connection<?>>();
	if (connections.size() > 0) {
		for (List<Connection<?>> connectionList : connections.values()) {
			for (Connection<?> connection : connectionList) {
				allConnections.add(connection);
			}
		}
	}
	return allConnections;
}