Package io.github.mahmoudimus.http3
Record Class Http3Frame.Unknown
java.lang.Object
java.lang.Record
io.github.mahmoudimus.http3.Http3Frame.Unknown
- Record Components:
type- the frame typepayload- the payload, not copied
- All Implemented Interfaces:
Http3Frame
- Enclosing interface:
Http3Frame
public static record Http3Frame.Unknown(long type, byte[] payload)
extends Record
implements Http3Frame
A frame of any other type: an extension, or a reserved type (0x1f * N + 0x21) used for
greasing. Kept whole so that it can be inspected, edited and relayed; a receiver must not
act on types it does not understand (§9). The HTTP/2-only types are never unknown frames:
receiving one is an error.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mahmoudimus.http3.Http3Frame
Http3Frame.CancelPush, Http3Frame.Data, Http3Frame.GoAway, Http3Frame.Headers, Http3Frame.MaxPushId, Http3Frame.PushPromise, Http3Frame.Settings, Http3Frame.Unknown -
Constructor Summary
ConstructorsConstructorDescriptionUnknown(long type, byte[] payload) Creates a frame of an extension or reserved type. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether this is a reserved (greasing) frame type.byte[]payload()Returns the value of thepayloadrecord component.final StringtoString()Returns a string representation of this record class.longtype()Returns the value of thetyperecord component.
-
Constructor Details
-
Unknown
public Unknown(long type, byte[] payload) Creates a frame of an extension or reserved type.- Parameters:
type- the frame type: neither a known nor an HTTP/2-only onepayload- the payload, not copied
-
-
Method Details
-
isReserved
public boolean isReserved()Whether this is a reserved (greasing) frame type.- Returns:
- whether the type is 0x1f * N + 0x21
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
public long type()Returns the value of thetyperecord component.- Specified by:
typein interfaceHttp3Frame- Returns:
- the value of the
typerecord component
-
payload
public byte[] payload()Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-