@Test public void testAddSetAndGetHeaders() throws Exception { System.out.println(builder.build().getHeaders()); assertEquals(1, builder.build().getHeaders().size()); builder.addHeader("header1", "header1_value1") .addHeader("header1", "header1_value2") .addHeader("header2", "header2_value1"); Map<String, List<String>> headers = builder.build().getHeaders(); assertEquals(3, headers.size()); assertEquals(2, headers.get("header1").size()); assertEquals("header1_value2", headers.get("header1").get(1)); assertEquals("header2_value1", headers.get("header2").get(0)); assertTrue(headers.containsKey("header1")); assertTrue(headers.containsKey("header2")); assertTrue(headers.get("header1").contains("header1_value1")); assertTrue(headers.get("header1").contains("header1_value2")); assertTrue(headers.get("header2").contains("header2_value1")); assertFalse(headers.get("header1").contains("header2_value1")); assertFalse(headers.get("header2").contains("header1_value1")); Map<String, Collection<String>> newHeaders = new HashMap<>(); List<String> header3Values = new ArrayList<>(), header4Values = new ArrayList<>(); header3Values.add("header3_value1"); header3Values.add("header3_value2"); header4Values.add("header4_value1"); newHeaders.put("header3", header3Values); newHeaders.put("header4", header4Values); builder.setHeaders(newHeaders); headers = builder.build().getHeaders(); assertEquals(3, headers.size()); assertEquals(2, headers.get("header3").size()); assertEquals("header3_value2", headers.get("header3").get(1)); assertEquals("header4_value1", headers.get("header4").get(0)); assertTrue(headers.containsKey("header3")); assertTrue(headers.containsKey("header4")); assertTrue(headers.get("header3").contains("header3_value1")); assertTrue(headers.get("header3").contains("header3_value2")); assertTrue(headers.get("header4").contains("header4_value1")); assertFalse(headers.get("header3").contains("header4_value1")); assertFalse(headers.get("header4").contains("header3_value1")); builder.setHeaders(null); headers = builder.build().getHeaders(); assertEquals(1, builder.build().getHeaders().size()); }
public Map<String, List<String>> getHeaders() { return Collections.unmodifiableMap(headers); }
ParsecAsyncHttpRequest { public Map<String, List<String>> getHeaders() { return Collections.unmodifiableMap(headers); } }
ParsecAsyncHttpRequest { public Map<String, List<String>> getHeaders() { return Collections.unmodifiableMap(headers); } @SuppressWarnings("unused")  ParsecAsyncHttpRequest(); private  ParsecAsyncHttpRequest(final Builder builder); }
ParsecAsyncHttpRequest { public Map<String, List<String>> getHeaders() { return Collections.unmodifiableMap(headers); } @SuppressWarnings("unused")  ParsecAsyncHttpRequest(); private  ParsecAsyncHttpRequest(final Builder builder); @Override boolean equals(Object object); @Override int hashCode(); String getBody(); byte[] getBodyByte(); String getBodyEncoding(); long getContentLength(); Collection<NewCookie> getCookies(); Map<String, List<String>> getFormParams(); String getHeaderString(String headerKey); Map<String, List<String>> getHeaders(); int getMaxRetries(); String getMethod(); String getProxyServer(); Map<String, List<String>> getQueryParams(); long getRangeOffset(); int getRequestTimeout(); List<Integer> getRetryStatusCodes(); List<Class<? extends Throwable>> getRetryExceptions(); URI getUri(); String getUrl(); String getVirtualHost(); boolean isCriticalGet(); boolean isFollowRedirect(); boolean isAcceptCompression(); ParsecNameResolver getNameResolver(); }
ParsecAsyncHttpRequest { public Map<String, List<String>> getHeaders() { return Collections.unmodifiableMap(headers); } @SuppressWarnings("unused")  ParsecAsyncHttpRequest(); private  ParsecAsyncHttpRequest(final Builder builder); @Override boolean equals(Object object); @Override int hashCode(); String getBody(); byte[] getBodyByte(); String getBodyEncoding(); long getContentLength(); Collection<NewCookie> getCookies(); Map<String, List<String>> getFormParams(); String getHeaderString(String headerKey); Map<String, List<String>> getHeaders(); int getMaxRetries(); String getMethod(); String getProxyServer(); Map<String, List<String>> getQueryParams(); long getRangeOffset(); int getRequestTimeout(); List<Integer> getRetryStatusCodes(); List<Class<? extends Throwable>> getRetryExceptions(); URI getUri(); String getUrl(); String getVirtualHost(); boolean isCriticalGet(); boolean isFollowRedirect(); boolean isAcceptCompression(); ParsecNameResolver getNameResolver();  }