Top Description Fields Constructors Methods
io.netty5.handler.codec.http2

public final Class Http2Flags

extends Object
Class Inheritance
Annotations
@UnstableApi
Imports
io.netty5.util.internal.UnstableApi

Provides utility methods for accessing specific flags as defined by the HTTP/2 spec.

Field Summary

Modifier and TypeField and Description
public static final short
public static final short
public static final short
public static final short
public static final short
private short

Constructor Summary

AccessConstructor and Description
public
public
Http2Flags(short value)

Method Summary

Modifier and TypeMethod and Description
public boolean
ack()

Determines whether the flag is set indicating that this frame is an ACK.

public Http2Flags
ack(boolean ack)

Sets the ACK flag.

public boolean
endOfHeaders()

Determines whether the END_HEADERS flag is set.

public Http2Flags
endOfHeaders(boolean endOfHeaders)

Sets the END_HEADERS flag.

public boolean
endOfStream()

Determines whether the END_STREAM flag is set.

public Http2Flags
endOfStream(boolean endOfStream)

Sets the END_STREAM flag.

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
getNumPriorityBytes()

Gets the number of bytes expected for the priority fields of the payload.

public int
getPaddingPresenceFieldLength()

Gets the length in bytes of the padding presence field expected in the payload.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean

Returns:

true if the flag is set
isFlagSet
(short
the mask identifying the bit for the particular flag being tested
mask
)

Indicates whether or not a particular flag is set.

public boolean
paddingPresent()

For frames that include padding, indicates if the PADDED field is present.

public Http2Flags
paddingPresent(boolean paddingPresent)

Sets the PADDED flag.

public boolean
priorityPresent()

Determines whether the flag is set indicating the presence of the exclusive, stream dependency, and weight fields in a HEADERS frame.

public Http2Flags
priorityPresent(boolean priorityPresent)

Sets the PRIORITY flag.

public Http2Flags

Returns:

this instance.
setFlag
(boolean
if the flag should be enabled or disabled.
on
,
short
the mask that identifies the bit for the flag.
mask
)

Generic method to set any flag.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public short
value()

Gets the underlying flags value.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

ACKback to summary
public static final short ACK
END_HEADERSback to summary
public static final short END_HEADERS
END_STREAMback to summary
public static final short END_STREAM
PADDEDback to summary
public static final short PADDED
PRIORITYback to summary
public static final short PRIORITY
valueback to summary
private short value

Constructor Detail

Http2Flagsback to summary
public Http2Flags()
Http2Flagsback to summary
public Http2Flags(short value)

Method Detail

ackback to summary
public boolean ack()

Determines whether the flag is set indicating that this frame is an ACK. Only applies for SETTINGS and PING frames.

ackback to summary
public Http2Flags ack(boolean ack)

Sets the ACK flag.

endOfHeadersback to summary
public boolean endOfHeaders()

Determines whether the END_HEADERS flag is set. Only applies for HEADERS, PUSH_PROMISE, and CONTINUATION frames.

endOfHeadersback to summary
public Http2Flags endOfHeaders(boolean endOfHeaders)

Sets the END_HEADERS flag.

endOfStreamback to summary
public boolean endOfStream()

Determines whether the END_STREAM flag is set. Only applies to DATA and HEADERS frames.

endOfStreamback to summary
public Http2Flags endOfStream(boolean endOfStream)

Sets the END_STREAM flag.

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getNumPriorityBytesback to summary
public int getNumPriorityBytes()

Gets the number of bytes expected for the priority fields of the payload. This is determined by the priorityPresent() flag.

getPaddingPresenceFieldLengthback to summary
public int getPaddingPresenceFieldLength()

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

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isFlagSetback to summary
public boolean isFlagSet(short mask)

Indicates whether or not a particular flag is set.

Parameters
mask:short

the mask identifying the bit for the particular flag being tested

Returns:boolean

true if the flag is set

paddingPresentback to summary
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.

paddingPresentback to summary
public Http2Flags paddingPresent(boolean paddingPresent)

Sets the PADDED flag.

priorityPresentback to summary
public boolean priorityPresent()

Determines whether the flag is set indicating the presence of the exclusive, stream dependency, and weight fields in a HEADERS frame.

priorityPresentback to summary
public Http2Flags priorityPresent(boolean priorityPresent)

Sets the PRIORITY flag.

setFlagback to summary
public Http2Flags setFlag(boolean on, short mask)

Generic method to set any flag.

Parameters
on:boolean

if the flag should be enabled or disabled.

mask:short

the mask that identifies the bit for the flag.

Returns:Http2Flags

this instance.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
valueback to summary
public short value()

Gets the underlying flags value.