Package io.vertx.core.http

Examples of io.vertx.core.http.CaseInsensitiveHeaders


  }

  @Test
  public void testAddTest7()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    CharSequence name = "name";
    CharSequence value = "value";

    assertEquals("name: value\n", mmap.add(name, value).toString());
  }
View Full Code Here


  }

  @Test
  public void testAddTest8()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    CharSequence name = "name";
    ArrayList<CharSequence> values = new ArrayList<CharSequence>();
    values.add("somevalue");

    assertEquals("name: somevalue\n", mmap.add(name, values).toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest9()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "";
    ArrayList<CharSequence> values = new ArrayList<CharSequence>();
    values.add("somevalue");

    assertEquals(": somevalue\n", mmap.add(name, values).toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest10()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "a";
    ArrayList<CharSequence> values = new ArrayList<CharSequence>();
    values.add("somevalue");

    assertEquals("a: somevalue\n", mmap.add(name, values).toString());
  }
View Full Code Here

  }

  @Test
  public void testAddTest11()
      throws Exception {
    MultiMap mmap = new CaseInsensitiveHeaders();
    String name = "";
    String strVal = "";

    assertEquals(": \n", mmap.add(name, strVal).toString());
  }
View Full Code Here

    this.address = other.address;
    this.replyAddress = other.replyAddress;
    this.messageCodec = other.messageCodec;
    if (other.headers != null) {
      List<Map.Entry<String, String>> entries = other.headers.entries();
      this.headers = new CaseInsensitiveHeaders();
      for (Map.Entry<String, String> entry: entries) {
        this.headers.add(entry.getKey(), entry.getValue());
      }
    }
    if (other.sentBody != null) {
View Full Code Here

      // The message has been read from the wire
      if (headersPos != 0) {
        decodeHeaders();
      }
      if (headers == null) {
        headers = new CaseInsensitiveHeaders();
      }
    }
    return headers;
  }
View Full Code Here

    int length = wireBuffer.getInt(headersPos);
    if (length != 0) {
      headersPos += 4;
      int numHeaders = wireBuffer.getInt(headersPos);
      headersPos += 4;
      headers = new CaseInsensitiveHeaders();
      for (int i = 0; i < numHeaders; i++) {
        int keyLength = wireBuffer.getInt(headersPos);
        headersPos += 4;
        byte[] bytes = wireBuffer.getBytes(headersPos, headersPos + keyLength);
        String key = new String(bytes, CharsetUtil.UTF_8);
View Full Code Here

  public DeliveryOptions(JsonObject json) {
    this.timeout = json.getLong("timeout", DEFAULT_TIMEOUT);
    this.codecName = json.getString("codecName", null);
    JsonObject hdrs = json.getJsonObject("headers", null);
    if (hdrs != null) {
      headers = new CaseInsensitiveHeaders();
      for (Map.Entry<String, Object> entry: hdrs) {
        if (!(entry.getValue() instanceof String)) {
          throw new IllegalStateException("Invalid type for message header value " + entry.getValue().getClass());
        }
        headers.set(entry.getKey(), (String)entry.getValue());
View Full Code Here

    return headers;
  }

  private void checkHeaders() {
    if (headers == null) {
      headers = new CaseInsensitiveHeaders();
    }
  }
View Full Code Here

TOP

Related Classes of io.vertx.core.http.CaseInsensitiveHeaders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.