Class Http2Flags

  • @UnstableApi
    public final class Http2Flags
    extends Object
    Provides utility methods for accessing specific flags as defined by the HTTP/2 spec.
    • Constructor Detail

      • Http2Flags

        public Http2Flags()
      • Http2Flags

        public Http2Flags​(short value)
    • Method Detail

      • value

        public short value()
        Gets the underlying flags value.
      • endOfStream

        public boolean endOfStream()
        Determines whether the END_STREAM flag is set. Only applies to DATA and HEADERS frames.
      • endOfHeaders

        public boolean endOfHeaders()
        Determines whether the END_HEADERS flag is set. Only applies for HEADERS, PUSH_PROMISE, and CONTINUATION frames.
      • priorityPresent

        public boolean priorityPresent()
        Determines whether the flag is set indicating the presence of the exclusive, stream dependency, and weight fields in a HEADERS frame.
      • ack

        public boolean ack()
        Determines whether the flag is set indicating that this frame is an ACK. Only applies for SETTINGS and PING frames.
      • paddingPresent

        public boolean paddingPresent()
        For frames that include padding, indicates if the PADDED field is present. Only applies to DATA, HEADERS, PUSH_PROMISE and CONTINUATION frames.
      • getNumPriorityBytes

        public int getNumPriorityBytes()
        Gets the number of bytes expected for the priority fields of the payload. This is determined by the priorityPresent() flag.
      • getPaddingPresenceFieldLength

        public int getPaddingPresenceFieldLength()
        Gets the length in bytes of the padding presence field expected in the payload. This is determined by the paddingPresent() flag.
      • priorityPresent

        public Http2Flags priorityPresent​(boolean priorityPresent)
        Sets the PRIORITY flag.
      • paddingPresent

        public Http2Flags paddingPresent​(boolean paddingPresent)
        Sets the PADDED flag.
      • ack

        public Http2Flags ack​(boolean ack)
        Sets the ACK flag.
      • setFlag

        public Http2Flags setFlag​(boolean on,
                                  short mask)
        Generic method to set any flag.
        on - if the flag should be enabled or disabled.
        mask - the mask that identifies the bit for the flag.
        this instance.
      • isFlagSet

        public boolean isFlagSet​(short mask)
        Indicates whether or not a particular flag is set.
        mask - the mask identifying the bit for the particular flag being tested
        true if the flag is set
      • hashCode

        public int hashCode()
        hashCode in class Object