Package org.glassfish.tyrus.core.frame
Class Frame.Builder
- java.lang.Object
-
- org.glassfish.tyrus.core.frame.Frame.Builder
-
- Enclosing class:
- Frame
public static final class Frame.Builder extends java.lang.Object
Frame builder.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Frame
build()
Build new frame.Frame.Builder
fin(boolean fin)
Set FIN flag.Frame.Builder
mask(boolean mask)
Currently not used.Frame.Builder
maskingKey(java.lang.Integer maskingKey)
Set masking key.Frame.Builder
opcode(byte opcode)
Set opcode.Frame.Builder
payloadData(byte[] payloadData)
Set payload data.Frame.Builder
payloadLength(long payloadLength)
Set payload length.Frame.Builder
rsv1(boolean rsv1)
Set RSV1 flag.Frame.Builder
rsv2(boolean rsv2)
Set RSV2 flag.Frame.Builder
rsv3(boolean rsv3)
Set RSV3 flag.
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructor.
-
Builder
public Builder(Frame frame)
Constructor.- Parameters:
frame
- frame used as a base for building new frame.
-
-
Method Detail
-
build
public Frame build()
Build new frame.- Returns:
- built frame.
-
fin
public Frame.Builder fin(boolean fin)
Set FIN flag.- Parameters:
fin
- value to be set as FIN.- Returns:
- updated
Frame.Builder
instance.
-
rsv1
public Frame.Builder rsv1(boolean rsv1)
Set RSV1 flag.- Parameters:
rsv1
- value to be set as RSV1.- Returns:
- updated
Frame.Builder
instance.
-
rsv2
public Frame.Builder rsv2(boolean rsv2)
Set RSV2 flag.- Parameters:
rsv2
- value to be set as RSV2.- Returns:
- updated
Frame.Builder
instance.
-
rsv3
public Frame.Builder rsv3(boolean rsv3)
Set RSV3 flag.- Parameters:
rsv3
- value to be set as RSV3.- Returns:
- updated
Frame.Builder
instance.
-
mask
public Frame.Builder mask(boolean mask)
Currently not used.- Parameters:
mask
- not used.- Returns:
- updated
Frame.Builder
instance.
-
opcode
public Frame.Builder opcode(byte opcode)
Set opcode.- Parameters:
opcode
- opcode to be set. (4 bits).- Returns:
- updated
Frame.Builder
instance.
-
payloadLength
public Frame.Builder payloadLength(long payloadLength)
Set payload length.Payload length is automatically set to payloadData length when
payloadData(byte[])
is called. This method can limit the data used for this frame by setting smaller value than payloadData.length.- Parameters:
payloadLength
- payload length. Must not be greater than payloadData.length.- Returns:
- updated
Frame.Builder
instance. - See Also:
payloadData(byte[])
-
maskingKey
public Frame.Builder maskingKey(java.lang.Integer maskingKey)
Set masking key. Default value isnull
.- Parameters:
maskingKey
- masking key.- Returns:
- updated
Frame.Builder
instance.
-
payloadData
public Frame.Builder payloadData(byte[] payloadData)
Set payload data.payloadLength(long)
is also updated with payloadData.length.- Parameters:
payloadData
- data to be set.- Returns:
- updated
Frame.Builder
instance. - See Also:
payloadLength(long)
-
-