Spring Framework LinkedMultiValueMap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework LinkedMultiValueMap class.

This code example shows how to use the following methods:
	} 
 
 
	@Override 
	protected MultiValueMap<HttpRequestHandler, String> createMappings() {
		return new LinkedMultiValueMap<HttpRequestHandler, String>();
	} 
 
	@Override 
	protected void addSockJsServiceMapping(MultiValueMap<HttpRequestHandler, String> mappings,
			SockJsService sockJsService, WebSocketHandler handler, String pathPattern) {
 
		SockJsHttpRequestHandler httpHandler = new SockJsHttpRequestHandler(sockJsService, handler);
		mappings.add(httpHandler, pathPattern);
	} 
 
	@Override 
	protected void addWebSocketHandlerMapping(MultiValueMap<HttpRequestHandler, String> mappings,
			WebSocketHandler wsHandler, HandshakeHandler handshakeHandler,
			HandshakeInterceptor[] interceptors, String path) {
7
CodeRank
This code example shows how to use the following methods:
	@Test
	public void testEquals() { 
		MultiValueMap<String, String> map1 = new LinkedMultiValueMap<String, String>();
		map1.set("Content-Type", "text/plain");
 
		MultiValueMap<String, String> map2 = new LinkedMultiValueMap<String, String>();
		map2.set("Content-Type", "application/json");
 
		assertTrue(new HttpEntity<Object>().equals(new HttpEntity<Object>()));
		assertFalse(new HttpEntity<Object>(map1).equals(new HttpEntity<Object>()));
		assertFalse(new HttpEntity<Object>().equals(new HttpEntity<Object>(map2)));
 
		assertTrue(new HttpEntity<Object>(map1).equals(new HttpEntity<Object>(map1)));
		assertFalse(new HttpEntity<Object>(map1).equals(new HttpEntity<Object>(map2)));
 
		assertTrue(new HttpEntity<String>(null, null).equals(new HttpEntity<String>(null, null)));
		assertFalse(new HttpEntity<String>("foo", null).equals(new HttpEntity<String>(null, null)));
		assertFalse(new HttpEntity<String>(null, null).equals(new HttpEntity<String>("bar", null)));
 
		assertTrue(new HttpEntity<String>("foo", map1).equals(new HttpEntity<String>("foo", map1)));
7
CodeRank
This code example shows how to use the following methods:
 * @since 2.0 
 * @see org.springframework.mock.web.MockMultipartFile 
 */ 
public class MockMultipartActionRequest extends MockActionRequest implements MultipartActionRequest {
 
	private final MultiValueMap<String, MultipartFile> multipartFiles =
			new LinkedMultiValueMap<String, MultipartFile>();
 
 
	/** 
	 * Add a file to this request. The parameter name from the multipart 
	 * form is taken from the {@link org.springframework.web.multipart.MultipartFile#getName()}. 
	 * @param file multipart file to be added 
	 */ 
	public void addFile(MultipartFile file) {
		Assert.notNull(file, "MultipartFile must not be null");
		this.multipartFiles.add(file.getName(), file);
	} 
 
	@Override 
7
CodeRank
This code example shows how to use the following methods:
		return graphApi.fetchConnections(eventId, "declined", EventInvitee.class);
	} 
	 
	public void acceptInvitation(String eventId) {
		requireAuthorization(); 
		graphApi.post(eventId, "attending", new LinkedMultiValueMap<String, String>());
	} 
 
	public void maybeInvitation(String eventId) {
		requireAuthorization(); 
		graphApi.post(eventId, "maybe", new LinkedMultiValueMap<String, String>());
	} 
 
	public void declineInvitation(String eventId) {
		requireAuthorization(); 
		graphApi.post(eventId, "declined", new LinkedMultiValueMap<String, String>());
	} 
	 
	public PagedList<Event> search(String query) {
		return search(query, new PagingParameters(25, 0, null, null));
6
CodeRank
This code example shows how to use the following methods:
		assertEquals("abc", flashMap.getTargetRequestParams().getFirst("text"));
	} 
 
	@Test
	public void addTargetRequestParamsNullValue() { 
		MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
		params.add("key", "abc");
		params.add("key", " ");
		params.add("key", null);
 
		FlashMap flashMap = new FlashMap();
		flashMap.addTargetRequestParams(params);
 
		assertEquals(1, flashMap.getTargetRequestParams().size());
		assertEquals(1, flashMap.getTargetRequestParams().get("key").size());
		assertEquals("abc", flashMap.getTargetRequestParams().getFirst("key"));
	} 
 
	@Test
	public void addTargetRequestParamNullKey() { 
7
CodeRank
This code example shows how to use the following methods:
	 * A protected constructor to create new headers. 
	 * @param nativeHeaders native headers to create the message with, may be {@code null} 
	 */ 
	protected NativeMessageHeaderAccessor(Map<String, List<String>> nativeHeaders) {
		if (!CollectionUtils.isEmpty(nativeHeaders)) {
			setHeader(NATIVE_HEADERS, new LinkedMultiValueMap<String, String>(nativeHeaders));
		} 
	} 
 
	/** 
	 * A protected constructor accepting the headers of an existing message to copy. 
	 */ 
	protected NativeMessageHeaderAccessor(Message<?> message) {
		super(message); 
		if (message != null) { 
			@SuppressWarnings("unchecked") 
			Map<String, List<String>> map = (Map<String, List<String>>) getHeader(NATIVE_HEADERS);
			if (map != null) {
				// Force removal since setHeader checks for equality 
				removeHeader(NATIVE_HEADERS);
6
CodeRank
This code example shows how to use the following methods:
		this.graphApi = graphApi;
	} 
 
	public void like(String objectId) {
		requireAuthorization(); 
		graphApi.post(objectId, "likes", new LinkedMultiValueMap<String, String>());
	} 
 
	public void unlike(String objectId) {
		requireAuthorization(); 
		graphApi.delete(objectId, "likes");
	} 
 
	public PagedList<Reference> getLikes(String objectId) {
		requireAuthorization(); 
		return graphApi.fetchConnections(objectId, "likes", Reference.class);
	} 
 
	public PagedList<Reference> getLikes(String objectId, PagingParameters pagingParameters) {
		requireAuthorization(); 
6
CodeRank
This code example shows how to use the following methods:
	private MultiValueMap<String, Person> people; 
 
 
	@Before 
	public void setup() { 
		this.people = new LinkedMultiValueMap<String, Person>(); 
		this.people.add("composers", new Person("Johann Sebastian Bach")); 
		this.people.add("composers", new Person("Johannes Brahms")); 
		this.people.add("composers", new Person("Edvard Grieg")); 
		this.people.add("composers", new Person("Robert Schumann")); 
		this.people.add("performers", new Person("Vladimir Ashkenazy")); 
		this.people.add("performers", new Person("Yehudi Menuhin")); 
 
		List<HttpMessageConverter<?>> converters = new ArrayList<HttpMessageConverter<?>>(); 
		converters.add(new MappingJackson2HttpMessageConverter()); 
 
		this.restTemplate = new RestTemplate(); 
		this.restTemplate.setMessageConverters(converters); 
 
		this.mockServer = MockRestServiceServer.createServer(this.restTemplate); 
7
CodeRank
This code example shows how to use the following methods:
 * @since 2.0 
 * @see MockMultipartFile 
 */ 
public class MockMultipartHttpServletRequest extends MockHttpServletRequest implements MultipartHttpServletRequest { 
 
	private final MultiValueMap<String, MultipartFile> multipartFiles = 
			new LinkedMultiValueMap<String, MultipartFile>(); 
 
 
	/** 
	 * Create a new {@code MockMultipartHttpServletRequest} with a default 
	 * {@link MockServletContext}. 
	 * @see #MockMultipartHttpServletRequest(ServletContext) 
	 */ 
	public MockMultipartHttpServletRequest() { 
		this(null); 
	} 
 
	/** 
	 * Create a new {@code MockMultipartHttpServletRequest} with the supplied {@link ServletContext}. 
7
CodeRank
This code example shows how to use the following methods:
 * @see MockMultipartFile 
 */ 
public class MockMultipartHttpServletRequest extends MockHttpServletRequest implements MultipartHttpServletRequest {
 
	private final MultiValueMap<String, MultipartFile> multipartFiles =
			new LinkedMultiValueMap<String, MultipartFile>();
 
 
	/** 
	 * Create a new {@code MockMultipartHttpServletRequest} with a default 
	 * {@link MockServletContext}. 
	 * @see #MockMultipartHttpServletRequest(ServletContext) 
	 */ 
	public MockMultipartHttpServletRequest() { 
		this(null); 
	} 
 
	/** 
	 * Create a new {@code MockMultipartHttpServletRequest} with the supplied {@link ServletContext}. 
	 * @param servletContext the ServletContext that the request runs in 
7
CodeRank