public static final class PiPacketOperation.Builder extends Object
Modifier and Type | Method and Description |
---|---|
PiPacketOperation |
build()
Builds a new instance of a packet operation.
|
PiPacketOperation.Builder |
forDevice(DeviceId deviceId)
Sets the device ID.
|
PiPacketOperation.Builder |
withData(ImmutableByteSequence data)
Sets the raw packet data.
|
PiPacketOperation.Builder |
withMetadata(PiControlMetadata metadata)
Adds a control metadata.
|
PiPacketOperation.Builder |
withMetadatas(Collection<PiControlMetadata> metadatas)
Adds many packet metadatas.
|
PiPacketOperation.Builder |
withType(PiPacketOperationType type)
Sets the type of this packet.
|
public PiPacketOperation.Builder forDevice(DeviceId deviceId)
deviceId
- device IDpublic PiPacketOperation.Builder withData(ImmutableByteSequence data)
data
- the packet raw datapublic PiPacketOperation.Builder withMetadata(PiControlMetadata metadata)
metadata
- packet metadatapublic PiPacketOperation.Builder withMetadatas(Collection<PiControlMetadata> metadatas)
metadatas
- collection of metadatapublic PiPacketOperation.Builder withType(PiPacketOperationType type)
type
- type of the packetpublic PiPacketOperation build()