Module org.refcodes.serial
Package org.refcodes.serial
Class FullDuplexPacketPortDecorator.Builder<PM extends PortMetrics>
- java.lang.Object
-
- org.refcodes.serial.FullDuplexPacketPortDecorator.Builder<PM>
-
- Type Parameters:
PM
- The actualPortMetrics
type to use.
- Enclosing class:
- FullDuplexPacketPortDecorator<PM extends PortMetrics>
public static final class FullDuplexPacketPortDecorator.Builder<PM extends PortMetrics> extends Object
Builder for building aFullDuplexPacketPortDecorator
instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FullDuplexPacketPortDecorator<PM>
build()
Builds the.FullDuplexPacketPortDecorator.Builder<PM>
withAcknowledgeMagicBytes(byte[] aAcknowledgeMagicBytes)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withAcknowledgeRetryNumber(int aAcknowledgeRetryNumber)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withAcknowledgeTimeoutInMs(long aAcknowledgeTimeoutInMs)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withCrcAlgorithm(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withCrcChecksumValidationMode(org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withEndianess(org.refcodes.numerical.Endianess aEndianess)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withExecutorService(ExecutorService aExecutorService)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withPort(Port<PM> aPort)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withSequenceNumberInitValue(int aSequenceNumberInitValue)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withSequenceNumberWidth(int aSequenceNumberWidth)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.FullDuplexPacketPortDecorator.Builder<PM>
withTransmissionMagicBytes(byte[] aTransmissionMagicBytes)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.
-
-
-
Method Detail
-
withEndianess
public FullDuplexPacketPortDecorator.Builder<PM> withEndianess(org.refcodes.numerical.Endianess aEndianess)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aEndianess
- TheEndianess
to use when calculating the CRC checksum.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withPort
public FullDuplexPacketPortDecorator.Builder<PM> withPort(Port<PM> aPort)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aPort
- the a port- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withTransmissionMagicBytes
public FullDuplexPacketPortDecorator.Builder<PM> withTransmissionMagicBytes(byte[] aTransmissionMagicBytes)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aTransmissionMagicBytes
- The magic bytes identifying a regular transmission (as ofFullDuplexPacketPortDecorator.transmitSegment(Segment)
or the like).- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withAcknowledgeMagicBytes
public FullDuplexPacketPortDecorator.Builder<PM> withAcknowledgeMagicBytes(byte[] aAcknowledgeMagicBytes)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aAcknowledgeMagicBytes
- The ACK character to be used by the return channel to transmit an ACK (acknowledge) response after successful receiving a transmission.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withAcknowledgeRetryNumber
public FullDuplexPacketPortDecorator.Builder<PM> withAcknowledgeRetryNumber(int aAcknowledgeRetryNumber)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aAcknowledgeRetryNumber
- The number of retries waiting for an ACK from the return channel.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withAcknowledgeTimeoutInMs
public FullDuplexPacketPortDecorator.Builder<PM> withAcknowledgeTimeoutInMs(long aAcknowledgeTimeoutInMs)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aAcknowledgeTimeoutInMs
- The timeout in milliseconds to pend till the next retry.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withSequenceNumberInitValue
public FullDuplexPacketPortDecorator.Builder<PM> withSequenceNumberInitValue(int aSequenceNumberInitValue)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aSequenceNumberInitValue
- The initialization value for the sequence number counter.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withSequenceNumberWidth
public FullDuplexPacketPortDecorator.Builder<PM> withSequenceNumberWidth(int aSequenceNumberWidth)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aSequenceNumberWidth
- The width in bytes to be used for the binary sequence number representation.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withCrcAlgorithm
public FullDuplexPacketPortDecorator.Builder<PM> withCrcAlgorithm(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aCrcAlgorithm
- TheCrcAlgorithm
to be used for CRC checksum calculation.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withCrcChecksumValidationMode
public FullDuplexPacketPortDecorator.Builder<PM> withCrcChecksumValidationMode(org.refcodes.numerical.ChecksumValidationMode aCrcChecksumValidationMode)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aCrcChecksumValidationMode
- The mode of operation when validating provided CRC checksums against calculated ones.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
withExecutorService
public FullDuplexPacketPortDecorator.Builder<PM> withExecutorService(ExecutorService aExecutorService)
Sets the according property for configuring theFullDuplexPacketPortDecorator
upon invokingbuild()
.- Parameters:
aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The
FullDuplexPacketPortDecorator.Builder
to chain other operations as of the builder pattern.
-
build
public FullDuplexPacketPortDecorator<PM> build()
Builds the.- Returns:
- the full duplex segment multiplexer
-
-