本文整理了Java中io.vertx.core.MultiMap.set()
方法的一些代码示例,展示了MultiMap.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.set()
方法的具体详情如下:
包路径:io.vertx.core.MultiMap
类名称:MultiMap
方法名:set
[英]Like #set(String,String) but accepting CharSequence as parameters
[中]比如#set(String,String),但接受CharSequence作为参数
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public HttpServerResponse putTrailer(CharSequence name, CharSequence value) {
synchronized (conn) {
checkValid();
trailers().set(name, value);
return this;
}
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public synchronized HttpClientRequest putHeader(CharSequence name, CharSequence value) {
checkComplete();
headers().set(name, value);
return this;
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public synchronized HttpClientRequest putHeader(CharSequence name, Iterable<CharSequence> values) {
checkComplete();
headers().set(name, values);
return this;
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public HttpServerResponse putHeader(CharSequence name, Iterable<CharSequence> values) {
synchronized (conn) {
checkHeadWritten();
headers().set(name, values);
return this;
}
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public synchronized HttpClientRequest putHeader(String name, Iterable<String> values) {
checkComplete();
headers().set(name, values);
return this;
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public HttpServerResponse putHeader(String name, Iterable<String> values) {
synchronized (conn) {
checkHeadWritten();
headers().set(name, values);
return this;
}
}
代码示例来源:origin: eclipse-vertx/vert.x
@Override
public HttpServerResponse putTrailer(String name, String value) {
synchronized (conn) {
checkEnded();
trailers().set(name, value);
return this;
}
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetTest8()
throws Exception {
MultiMap mmap = newMultiMap();
CharSequence name = "name";
ArrayList<CharSequence> values = new ArrayList<CharSequence>();
values.add("somevalue");
assertEquals("name: somevalue\n", mmap.set(name, values).toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetTest9()
throws Exception {
MultiMap mmap = newMultiMap();
String name = "";
ArrayList<CharSequence> values = new ArrayList<CharSequence>();
values.add("somevalue");
assertEquals(": somevalue\n", mmap.set(name, values).toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetTest10()
throws Exception {
MultiMap mmap = newMultiMap();
String name = "aaa";
ArrayList<CharSequence> values = new ArrayList<CharSequence>();
values.add("somevalue");
assertEquals("aaa: somevalue\n", mmap.set(name, values).toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetIterableEmpty()
throws Exception {
MultiMap mmap = newMultiMap();
String name = "name";
List<String> values = new ArrayList<String>();
MultiMap result = mmap.set(name, values);
assertNotNull(result);
assertTrue(result.isEmpty());
assertEquals(0, result.size());
assertEquals("", result.toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testGetConvertUpperCase() {
map.set("foo", "foo_value");
assertEquals("foo_value", map.get("Foo"));
assertEquals("foo_value", map.get((CharSequence) "Foo"));
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetTest12()
throws Exception {
MultiMap mmap = newMultiMap();
String name = "aaa";
String strVal = "bbb";
MultiMap result = mmap.set(name, strVal);
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals("aaa: bbb\n", result.toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetTest7()
throws Exception {
MultiMap mmap = newMultiMap();
CharSequence name = "name";
CharSequence value = "value";
MultiMap result = mmap.set(name, value);
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals("name: value\n", result.toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testSetTest11()
throws Exception {
MultiMap mmap = newMultiMap();
String name = "";
String strVal = "";
MultiMap result = mmap.set(name, strVal);
assertNotNull(result);
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals(": \n", result.toString());
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testHeadRemovesTransferEncodingHeader() throws Exception {
MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.HEAD, 200, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked"));
assertNull(respHeaders.get("content-length"));
assertNull(respHeaders.get("transfer-encoding"));
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testNoContentRemovesContentLengthHeader() throws Exception {
MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 204, MultiMap.caseInsensitiveMultiMap().set("content-length", "34"));
assertNull(respHeaders.get("content-length"));
assertNull(respHeaders.get("transfer-encoding"));
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testNoContentRemovesTransferEncodingHeader() throws Exception {
MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 204, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked"));
assertNull(respHeaders.get("content-length"));
assertNull(respHeaders.get("transfer-encoding"));
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void testNotModifiedRemovesTransferEncodingHeader() throws Exception {
MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 304, MultiMap.caseInsensitiveMultiMap().set("transfer-encoding", "chunked"));
assertNull(respHeaders.get("content-length"));
assertNull(respHeaders.get("transfer-encoding"));
}
代码示例来源:origin: eclipse-vertx/vert.x
@Test
public void test1xxRemovesContentLengthHeader() throws Exception {
MultiMap respHeaders = checkEmptyHttpResponse(HttpMethod.GET, 102, MultiMap.caseInsensitiveMultiMap().set("content-length", "34"));
assertNull(respHeaders.get("content-length"));
assertNull(respHeaders.get("transfer-encoding"));
}
内容来源于网络,如有侵权,请联系作者删除!