Module bus.http

Class Http2Header

java.lang.Object
org.miaixz.bus.http.metric.http.Http2Header

public class Http2Header extends Object
An HTTP header: the name is an ASCII string, but the value can be UTF-8.
Since:
Java 17+
Author:
Kimi Liu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    The size of this header in HPACK's format.
    final org.miaixz.bus.core.io.ByteString
    Name in case-insensitive ASCII encoding.
    static final org.miaixz.bus.core.io.ByteString
    The ":" prefix used for pseudo-headers.
    static final org.miaixz.bus.core.io.ByteString
    The ":status" pseudo-header.
    static final org.miaixz.bus.core.io.ByteString
    The ":authority" pseudo-header.
    static final org.miaixz.bus.core.io.ByteString
    The ":method" pseudo-header.
    static final org.miaixz.bus.core.io.ByteString
    The ":path" pseudo-header.
    static final org.miaixz.bus.core.io.ByteString
    The ":scheme" pseudo-header.
    final org.miaixz.bus.core.io.ByteString
    Value in UTF-8 encoding.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Http2Header(String name, String value)
    Constructs a new Http2Header with the given name and value.
    Http2Header(org.miaixz.bus.core.io.ByteString name, String value)
    Constructs a new Http2Header with the given name and value.
    Http2Header(org.miaixz.bus.core.io.ByteString name, org.miaixz.bus.core.io.ByteString value)
    Constructs a new Http2Header with the given name and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object other)
    Compares this Http2Header to another object for equality.
    int
    Returns the hash code for this Http2Header.
    Returns a string representation of this Http2Header.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • PSEUDO_PREFIX

      public static final org.miaixz.bus.core.io.ByteString PSEUDO_PREFIX
      The ":" prefix used for pseudo-headers.
    • RESPONSE_STATUS

      public static final org.miaixz.bus.core.io.ByteString RESPONSE_STATUS
      The ":status" pseudo-header.
    • TARGET_METHOD

      public static final org.miaixz.bus.core.io.ByteString TARGET_METHOD
      The ":method" pseudo-header.
    • TARGET_PATH

      public static final org.miaixz.bus.core.io.ByteString TARGET_PATH
      The ":path" pseudo-header.
    • TARGET_SCHEME

      public static final org.miaixz.bus.core.io.ByteString TARGET_SCHEME
      The ":scheme" pseudo-header.
    • TARGET_AUTHORITY

      public static final org.miaixz.bus.core.io.ByteString TARGET_AUTHORITY
      The ":authority" pseudo-header.
    • name

      public final org.miaixz.bus.core.io.ByteString name
      Name in case-insensitive ASCII encoding.
    • value

      public final org.miaixz.bus.core.io.ByteString value
      Value in UTF-8 encoding.
    • hpackSize

      public final int hpackSize
      The size of this header in HPACK's format.
  • Constructor Details

    • Http2Header

      public Http2Header(String name, String value)
      Constructs a new Http2Header with the given name and value.
      Parameters:
      name - The header name.
      value - The header value.
    • Http2Header

      public Http2Header(org.miaixz.bus.core.io.ByteString name, String value)
      Constructs a new Http2Header with the given name and value.
      Parameters:
      name - The header name as a ByteString.
      value - The header value as a String.
    • Http2Header

      public Http2Header(org.miaixz.bus.core.io.ByteString name, org.miaixz.bus.core.io.ByteString value)
      Constructs a new Http2Header with the given name and value.
      Parameters:
      name - The header name as a ByteString.
      value - The header value as a ByteString.
  • Method Details

    • equals

      public boolean equals(Object other)
      Compares this Http2Header to another object for equality.
      Overrides:
      equals in class Object
      Parameters:
      other - The object to compare to.
      Returns:
      true if the objects are equal, false otherwise.
    • hashCode

      public int hashCode()
      Returns the hash code for this Http2Header.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
    • toString

      public String toString()
      Returns a string representation of this Http2Header.
      Overrides:
      toString in class Object
      Returns:
      The string representation.