Package org.onosproject.net.pi.runtime
Class PiPacketOperation.Builder
- java.lang.Object
-
- org.onosproject.net.pi.runtime.PiPacketOperation.Builder
-
- Enclosing class:
- PiPacketOperation
public static final class PiPacketOperation.Builder extends Object
Builder of packet operations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PiPacketOperation
build()
Builds a new instance of a packet operation.PiPacketOperation.Builder
withData(ImmutableByteSequence data)
Sets the raw packet data.PiPacketOperation.Builder
withMetadata(PiPacketMetadata metadata)
Adds a packet metadata.PiPacketOperation.Builder
withMetadatas(Collection<PiPacketMetadata> metadatas)
Adds many packet metadatas.PiPacketOperation.Builder
withType(PiPacketOperationType type)
Sets the type of this packet.
-
-
-
Method Detail
-
withData
public PiPacketOperation.Builder withData(ImmutableByteSequence data)
Sets the raw packet data.- Parameters:
data
- the packet raw data- Returns:
- this
-
withMetadata
public PiPacketOperation.Builder withMetadata(PiPacketMetadata metadata)
Adds a packet metadata. Only one metadata is allowed for a given metadata id. If a metadata with same id already exists it will be replaced by the given one.- Parameters:
metadata
- packet metadata- Returns:
- this
-
withMetadatas
public PiPacketOperation.Builder withMetadatas(Collection<PiPacketMetadata> metadatas)
Adds many packet metadatas.- Parameters:
metadatas
- collection of metadata- Returns:
- this
-
withType
public PiPacketOperation.Builder withType(PiPacketOperationType type)
Sets the type of this packet.- Parameters:
type
- type of the packet- Returns:
- this
-
build
public PiPacketOperation build()
Builds a new instance of a packet operation.- Returns:
- packet operation
-
-