Package io.netty.handler.codec.http2
Class Http2Flags
- java.lang.Object
-
- io.netty.handler.codec.http2.Http2Flags
-
public final class Http2Flags extends java.lang.ObjectProvides utility methods for accessing specific flags as defined by the HTTP/2 spec.
-
-
Field Summary
Fields Modifier and Type Field Description static shortACKstatic shortEND_HEADERSstatic shortEND_STREAMstatic shortPADDEDstatic shortPRIORITY
-
Constructor Summary
Constructors Constructor Description Http2Flags()Http2Flags(short value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanack()Determines whether the flag is set indicating that this frame is an ACK.Http2Flagsack(boolean ack)Sets theACKflag.booleanendOfHeaders()Determines whether theEND_HEADERSflag is set.Http2FlagsendOfHeaders(boolean endOfHeaders)Sets theEND_HEADERSflag.booleanendOfStream()Determines whether theEND_STREAMflag is set.Http2FlagsendOfStream(boolean endOfStream)Sets theEND_STREAMflag.booleanequals(java.lang.Object obj)intgetNumPriorityBytes()Gets the number of bytes expected for the priority fields of the payload.intgetPaddingPresenceFieldLength()Gets the length in bytes of the padding presence field expected in the payload.inthashCode()booleanisFlagSet(short mask)Indicates whether or not a particular flag is set.booleanpaddingPresent()For frames that include padding, indicates if thePADDEDfield is present.Http2FlagspaddingPresent(boolean paddingPresent)Sets thePADDEDflag.booleanpriorityPresent()Determines whether the flag is set indicating the presence of the exclusive, stream dependency, and weight fields in a HEADERS frame.Http2FlagspriorityPresent(boolean priorityPresent)Sets thePRIORITYflag.Http2FlagssetFlag(boolean on, short mask)Generic method to set any flag.java.lang.StringtoString()shortvalue()Gets the underlying flags value.
-
-
-
Field Detail
-
END_STREAM
public static final short END_STREAM
- See Also:
- Constant Field Values
-
END_HEADERS
public static final short END_HEADERS
- See Also:
- Constant Field Values
-
ACK
public static final short ACK
- See Also:
- Constant Field Values
-
PADDED
public static final short PADDED
- See Also:
- Constant Field Values
-
PRIORITY
public static final short PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
value
public short value()
Gets the underlying flags value.
-
endOfStream
public boolean endOfStream()
Determines whether theEND_STREAMflag is set. Only applies to DATA and HEADERS frames.
-
endOfHeaders
public boolean endOfHeaders()
Determines whether theEND_HEADERSflag 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 thePADDEDfield 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 thepriorityPresent()flag.
-
getPaddingPresenceFieldLength
public int getPaddingPresenceFieldLength()
Gets the length in bytes of the padding presence field expected in the payload. This is determined by thepaddingPresent()flag.
-
endOfStream
public Http2Flags endOfStream(boolean endOfStream)
Sets theEND_STREAMflag.
-
endOfHeaders
public Http2Flags endOfHeaders(boolean endOfHeaders)
Sets theEND_HEADERSflag.
-
priorityPresent
public Http2Flags priorityPresent(boolean priorityPresent)
Sets thePRIORITYflag.
-
paddingPresent
public Http2Flags paddingPresent(boolean paddingPresent)
Sets thePADDEDflag.
-
ack
public Http2Flags ack(boolean ack)
Sets theACKflag.
-
setFlag
public Http2Flags setFlag(boolean on, short mask)
Generic method to set any flag.- Parameters:
on- if the flag should be enabled or disabled.mask- the mask that identifies the bit for the flag.- Returns:
- this instance.
-
isFlagSet
public boolean isFlagSet(short mask)
Indicates whether or not a particular flag is set.- Parameters:
mask- the mask identifying the bit for the particular flag being tested- Returns:
trueif the flag is set
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-