當前位置: 首頁>>代碼示例>>Java>>正文


Java MultiValueMap.get方法代碼示例

本文整理匯總了Java中org.springframework.util.MultiValueMap.get方法的典型用法代碼示例。如果您正苦於以下問題:Java MultiValueMap.get方法的具體用法?Java MultiValueMap.get怎麽用?Java MultiValueMap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.util.MultiValueMap的用法示例。


在下文中一共展示了MultiValueMap.get方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findAllConnections

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
@Override
public MultiValueMap<String, Connection<?>> findAllConnections() {
    List<SocialUserConnection> socialUserConnections = socialUserConnectionRepository
                    .findAllByUserIdOrderByProviderIdAscRankAsc(userId);
    List<Connection<?>> connections = socialUserConnectionsToConnections(socialUserConnections);
    MultiValueMap<String, Connection<?>> connectionsByProviderId = new LinkedMultiValueMap<>();
    Set<String> registeredProviderIds = connectionFactoryLocator.registeredProviderIds();
    for (String registeredProviderId : registeredProviderIds) {
        connectionsByProviderId.put(registeredProviderId, Collections.emptyList());
    }
    for (Connection<?> connection : connections) {
        String providerId = connection.getKey().getProviderId();
        if (connectionsByProviderId.get(providerId) == null || connectionsByProviderId.get(providerId).size() == 0) {
            connectionsByProviderId.put(providerId, new LinkedList<>());
        }
        connectionsByProviderId.add(providerId, connection);
    }
    return connectionsByProviderId;
}
 
開發者ID:xm-online,項目名稱:xm-uaa,代碼行數:20,代碼來源:CustomSocialConnectionRepository.java

示例2: replaceRequestParamNames

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
/**
 * 替換請求參數名
 *
 * @param webhook
 * @param requestBody
 * @return
 */
private Object replaceRequestParamNames(WebhookDetail webhook, Object requestBody) {
    if (ContentType.FORM.equals(webhook.getContentType())) {

        // 替換前的參數Map
        MultiValueMap<String, Object> sourceParamMap = (MultiValueMap<String, Object>) requestBody;

        // 替換後的參數Map
        MultiValueMap<String, Object> targetParamMap = new LinkedMultiValueMap<>();

        // 參數名映射
        Map<String, String> paramMapping = webhook.getRequestParams();

        String targetParamName = null;
        List<Object> paramValue = null;
        for (String sourceParamName : sourceParamMap.keySet()) {
            targetParamName = paramMapping.get(sourceParamName);
            if (StringUtils.isEmpty(targetParamName)) {
                targetParamName = sourceParamName;
            }
            paramValue = sourceParamMap.get(sourceParamName);
            targetParamMap.put(targetParamName, paramValue);
        }

        return targetParamMap;

    } else {
        return requestBody;
    }
}
 
開發者ID:zouzhirong,項目名稱:configx,代碼行數:37,代碼來源:HookEventHandlerSupport.java

示例3: isMultipart

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
private boolean isMultipart(MultiValueMap<String, ?> map, MediaType contentType) {
    if (contentType != null) {
        return MediaType.MULTIPART_FORM_DATA.includes(contentType)
            || mixed.includes(contentType)
            || related.includes(contentType);
    }
    for (Map.Entry<String, ?> entiry : map.entrySet()) {
        for (Object value : map.get(entiry.getKey())) {
            if (value != null && !(value instanceof String)) {
                return true;
            }
        }
    }
    return false;
}
 
開發者ID:xm-online,項目名稱:xm-ms-entity,代碼行數:16,代碼來源:MultipartMixedConverter.java

示例4: collect

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
protected void collect(MultiValueMap<String, Object> attributes, String key, List<String> destination) {
    List<?> values = attributes.get(key);
    if (values != null) {
        for (Object value : values) {
            if (value instanceof String[]) {
                Collections.addAll(destination, (String[]) value);
            } else {
                destination.add((String) value);
            }
        }
    }
}
 
開發者ID:drtrang,項目名稱:spring-boot-autoconfigure,代碼行數:13,代碼來源:OnBeansCondition.java

示例5: decodeMatrixVariables

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
/**
 * 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;
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:26,代碼來源:UrlPathHelper.java

示例6: matches

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
	if (context.getEnvironment() != null) {
		MultiValueMap<String, Object> attrs = metadata.getAllAnnotationAttributes(Profile.class.getName());
		if (attrs != null) {
			for (Object value : attrs.get("value")) {
				if (context.getEnvironment().acceptsProfiles(((String[]) value))) {
					return true;
				}
			}
			return false;
		}
	}
	return true;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:ProfileCondition.java

示例7: isMultipart

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
private boolean isMultipart(MultiValueMap<String, ?> map, MediaType contentType) {
	if (contentType != null) {
		return MediaType.MULTIPART_FORM_DATA.equals(contentType);
	}
	for (String name : map.keySet()) {
		for (Object value : map.get(name)) {
			if (value != null && !(value instanceof String)) {
				return true;
			}
		}
	}
	return false;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:14,代碼來源:FormHttpMessageConverter.java

示例8: restoreAsFieldDict

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
private void restoreAsFieldDict(IntensionDai.ChannelExtensionId extension, MultiValueMap<String, IntensionDai.Record> map) throws BadRequest, NotFound, Panic {
    List<IntensionDai.Record> records = intensionDai.loadLast(extension);
    for (IntensionDai.Record record : records) {
        String refSet = record.getRefSet();
        if (refSet != null) {
            ModelPublicationDai.ChannelSet set = new ModelPublicationDai.ChannelSet();
            set.setSet(refSet);
            List<ModelPublicationDai.Record> publications = modelPublicationDai.loadPublications(set);

            ModelPublicationDai.Record publication = publications.get(0);
            IntensionDai.ChannelExtensionId refExt = new IntensionDai.ChannelExtensionId();
            refExt.setBeginTime(publication.getBeginTime());
            refExt.setEndTime(record.getBeginTime());
            refExt.setId(publication.getExtId());

            MultiValueMap<String, IntensionDai.Record> subMap = restoreAsIntensionDict(refExt);
            for (String key : subMap.keySet()) {
                List<IntensionDai.Record> subRecords = subMap.get(key);
                for (IntensionDai.Record subRecord : subRecords) {
                    map.add(record.getField(), subRecord);
                }
            }
        } else {
            map.set(record.getField(), record);
        }
    }
}
 
開發者ID:SINeWang,項目名稱:kiimate,代碼行數:28,代碼來源:DefaultModelRestoreFui.java

示例9: search

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
public SearchResult<Conversation> search(Client client, MultiValueMap<String, String> queryParams) throws IOException {

        final ModifiableSolrParams solrParams = new ModifiableSolrParams(toListOfStringArrays(queryParams, "text"));

        solrParams.add(CommonParams.FL, "id");
        solrParams.add(CommonParams.FQ, String.format("%s:\"%s\"", FIELD_OWNER, client.getId().toHexString()));
        solrParams.add(CommonParams.FQ, String.format("%s:\"%s\"", FIELD_TYPE, TYPE_MESSAGE));
        solrParams.set(GroupParams.GROUP, "true");
        solrParams.set(GroupParams.GROUP_FIELD, "_root_");
        solrParams.set("group.ngroups", "true");
        if (queryParams.containsKey("text")) {
            List<String> searchTerms = queryParams.get("text");
            String query = SearchUtils.createSearchWordQuery(searchTerms.stream()
                    .filter(StringUtils::isNotBlank).collect(Collectors.joining(" ")));
            if(query != null){
                solrParams.set(CommonParams.Q, query);
            }
        }
        log.trace("SolrParams: {}", solrParams);

        try (SolrClient solrClient = solrServer.getSolrClient(conversationCore)) {

            final QueryResponse queryResponse = solrClient.query(solrParams);


            return fromQueryResponse(queryResponse, this::readConversation);

        } catch (SolrServerException e) {
            throw new IllegalStateException("Cannot query non-initialized core", e);
        }
    }
 
開發者ID:redlink-gmbh,項目名稱:smarti,代碼行數:32,代碼來源:ConversationSearchService.java

示例10: getConditionClasses

import org.springframework.util.MultiValueMap; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private List<String[]> getConditionClasses(AnnotatedTypeMetadata metadata) {
	MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(Conditional.class.getName(), true);
	Object values = (attributes != null ? attributes.get("value") : null);
	return (List<String[]>) (values != null ? values : Collections.emptyList());
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:7,代碼來源:ConditionEvaluator.java


注:本文中的org.springframework.util.MultiValueMap.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。