Class HandshakePortController.Builder<PM extends org.refcodes.serial.PortMetrics>
- java.lang.Object
-
- org.refcodes.serial.ext.handshake.HandshakePortController.Builder<PM>
-
- Type Parameters:
PM
- The actualPortMetrics
type to use.
- All Implemented Interfaces:
org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<HandshakePortController.Builder<PM>>
,org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<HandshakePortController.Builder<PM>>
,org.refcodes.numerical.EndianessAccessor.EndianessBuilder<HandshakePortController.Builder<PM>>
,org.refcodes.serial.AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<HandshakePortController.Builder<PM>>
,org.refcodes.serial.AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<HandshakePortController.Builder<PM>>
,ReplyRetryNumberAccessor.ReplyRetryNumberBuilder<HandshakePortController.Builder<PM>>
,ReplyTimeoutInMsAccessor.ReplyTimeoutInMsBuilder<HandshakePortController.Builder<PM>>
,org.refcodes.serial.SequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<HandshakePortController.Builder<PM>>
,org.refcodes.serial.SequenceNumberWidthAccessor.SequenceNumberWidthBuilder<HandshakePortController.Builder<PM>>
- Enclosing class:
- HandshakePortController<PM extends org.refcodes.serial.PortMetrics>
public static final class HandshakePortController.Builder<PM extends org.refcodes.serial.PortMetrics> extends Object implements org.refcodes.serial.AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<HandshakePortController.Builder<PM>>, org.refcodes.serial.AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<HandshakePortController.Builder<PM>>, ReplyTimeoutInMsAccessor.ReplyTimeoutInMsBuilder<HandshakePortController.Builder<PM>>, ReplyRetryNumberAccessor.ReplyRetryNumberBuilder<HandshakePortController.Builder<PM>>, org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<HandshakePortController.Builder<PM>>, org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<HandshakePortController.Builder<PM>>, org.refcodes.numerical.EndianessAccessor.EndianessBuilder<HandshakePortController.Builder<PM>>, org.refcodes.serial.SequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<HandshakePortController.Builder<PM>>, org.refcodes.serial.SequenceNumberWidthAccessor.SequenceNumberWidthBuilder<HandshakePortController.Builder<PM>>
Builder for building aHandshakePortController
instance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandshakePortController<PM>
build()
Builds the.HandshakePortController.Builder<PM>
withAcknowledgeRetryNumber(int aAcknowledgeRetryNumber)
HandshakePortController.Builder<PM>
withAcknowledgeTimeoutInMs(long aAcknowledgeTimeoutInMs)
HandshakePortController.Builder<PM>
withChecksumValidationMode(org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode)
HandshakePortController.Builder<PM>
withCrcAlgorithm(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
HandshakePortController.Builder<PM>
withEndianess(org.refcodes.numerical.Endianess aEndianess)
HandshakePortController.Builder<PM>
withExecutorService(ExecutorService aExecutorService)
Sets the according property for configuring theHandshakePortController
upon invokingbuild()
.HandshakePortController.Builder<PM>
withInboundQueueCapacity(int aInboundQueueCapacity)
Sets the queue capacity of unprocessed inbound messages.HandshakePortController.Builder<PM>
withPort(org.refcodes.serial.Port<PM> aPort)
Sets the according property for configuring theHandshakePortController
upon invokingbuild()
.HandshakePortController.Builder<PM>
withReplyRetryNumber(int aReplyRetryNumber)
Sets the number of retries for the reply retry number.HandshakePortController.Builder<PM>
withReplyTimeoutInMs(long aReplyTimeoutInMs)
Sets the number for the reply timeout property.HandshakePortController.Builder<PM>
withSequenceNumberInitValue(int aSequenceNumberInitValue)
HandshakePortController.Builder<PM>
withSequenceNumberWidth(int aSequenceNumberWidth)
-
-
-
Method Detail
-
withReplyRetryNumber
public HandshakePortController.Builder<PM> withReplyRetryNumber(int aReplyRetryNumber)
Sets the number of retries for the reply retry number. A reply retry number is the overall number of retries to use when counting retries.- Specified by:
withReplyRetryNumber
in interfaceReplyRetryNumberAccessor.ReplyRetryNumberBuilder<PM extends org.refcodes.serial.PortMetrics>
- Parameters:
aReplyRetryNumber
- The number of retries to be stored by the number of reply retry number.- Returns:
- The builder for applying multiple build operations.
-
withReplyTimeoutInMs
public HandshakePortController.Builder<PM> withReplyTimeoutInMs(long aReplyTimeoutInMs)
Sets the number for the reply timeout property.- Specified by:
withReplyTimeoutInMs
in interfaceReplyTimeoutInMsAccessor.ReplyTimeoutInMsBuilder<PM extends org.refcodes.serial.PortMetrics>
- Parameters:
aReplyTimeoutInMs
- The reply timeout in milliseconds to be stored by the reply timeout property.- Returns:
- The builder for applying multiple build operations.
-
withAcknowledgeRetryNumber
public HandshakePortController.Builder<PM> withAcknowledgeRetryNumber(int aAcknowledgeRetryNumber)
- Specified by:
withAcknowledgeRetryNumber
in interfaceorg.refcodes.serial.AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withAcknowledgeTimeoutInMs
public HandshakePortController.Builder<PM> withAcknowledgeTimeoutInMs(long aAcknowledgeTimeoutInMs)
- Specified by:
withAcknowledgeTimeoutInMs
in interfaceorg.refcodes.serial.AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withCrcAlgorithm
public HandshakePortController.Builder<PM> withCrcAlgorithm(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm)
- Specified by:
withCrcAlgorithm
in interfaceorg.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withChecksumValidationMode
public HandshakePortController.Builder<PM> withChecksumValidationMode(org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode)
- Specified by:
withChecksumValidationMode
in interfaceorg.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withEndianess
public HandshakePortController.Builder<PM> withEndianess(org.refcodes.numerical.Endianess aEndianess)
- Specified by:
withEndianess
in interfaceorg.refcodes.numerical.EndianessAccessor.EndianessBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withSequenceNumberInitValue
public HandshakePortController.Builder<PM> withSequenceNumberInitValue(int aSequenceNumberInitValue)
- Specified by:
withSequenceNumberInitValue
in interfaceorg.refcodes.serial.SequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withSequenceNumberWidth
public HandshakePortController.Builder<PM> withSequenceNumberWidth(int aSequenceNumberWidth)
- Specified by:
withSequenceNumberWidth
in interfaceorg.refcodes.serial.SequenceNumberWidthAccessor.SequenceNumberWidthBuilder<PM extends org.refcodes.serial.PortMetrics>
-
withInboundQueueCapacity
public HandshakePortController.Builder<PM> withInboundQueueCapacity(int aInboundQueueCapacity)
Sets the queue capacity of unprocessed inbound messages.- Parameters:
aInboundQueueCapacity
- The capacity of the inbound queue, any exceeding inbound transmissions are skipped.- Returns:
- The
HandshakePortController.Builder
to chain other operations as of the builder pattern.
-
withExecutorService
public HandshakePortController.Builder<PM> withExecutorService(ExecutorService aExecutorService)
Sets the according property for configuring theHandshakePortController
upon invokingbuild()
.- Parameters:
aExecutorService
- TheExecutorService
to be used when creatingThread
instances for handling input and output data simultaneously.- Returns:
- The
HandshakePortController.Builder
to chain other operations as of the builder pattern.
-
withPort
public HandshakePortController.Builder<PM> withPort(org.refcodes.serial.Port<PM> aPort)
Sets the according property for configuring theHandshakePortController
upon invokingbuild()
.- Parameters:
aPort
- the a port- Returns:
- The
HandshakePortController.Builder
to chain other operations as of the builder pattern.
-
build
public HandshakePortController<PM> build()
Builds the.- Returns:
- the full duplex segment multiplexer
-
-