java.lang.Object
org.refcodes.serial.PacketInputStream.Builder
org.refcodes.serial.StopAndWaitPacketInputStream.Builder
- All Implemented Interfaces:
org.refcodes.mixin.BlockSizeAccessor.BlockSizeBuilder<PacketInputStream.Builder>
,org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<PacketInputStream.Builder>
,org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<PacketInputStream.Builder>
,org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<PacketInputStream.Builder>
,org.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<PacketInputStream.Builder>
,org.refcodes.numerical.EndianessAccessor.EndianessBuilder<PacketInputStream.Builder>
,AcknowledgeMagicBytesAccessor.AcknowledgeMagicBytesBuilder<StopAndWaitPacketInputStream.Builder>
,AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<StopAndWaitPacketInputStream.Builder>
,AcknowledgeSegmentPackagerAccessor.AcknowledgeSegmentPackagerBuilder<StopAndWaitPacketInputStream.Builder>
,AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<StopAndWaitPacketInputStream.Builder>
,OutputReturnStreamAccessor.OutputReturnStreamBuilder<StopAndWaitPacketInputStream.Builder>
,PacketLengthWidthAccessor.PacketLengthWidthBuilder<PacketInputStream.Builder>
,PacketMagicBytesAccessor.PacketMagicBytesBuilder<PacketInputStream.Builder>
,PacketSegmentPackagerAccessor.PacketSegmentPackagerBuilder<PacketInputStream.Builder>
,SequenceNumberConcatenateModeAccessor.SequenceNumberConcatenateModeBuilder<PacketInputStream.Builder>
,SequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<PacketInputStream.Builder>
,SequenceNumberWidthAccessor.SequenceNumberWidthBuilder<PacketInputStream.Builder>
- Enclosing class:
StopAndWaitPacketInputStream
public static class StopAndWaitPacketInputStream.Builder
extends PacketInputStream.Builder
implements AcknowledgeMagicBytesAccessor.AcknowledgeMagicBytesBuilder<StopAndWaitPacketInputStream.Builder>, AcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<StopAndWaitPacketInputStream.Builder>, AcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<StopAndWaitPacketInputStream.Builder>, OutputReturnStreamAccessor.OutputReturnStreamBuilder<StopAndWaitPacketInputStream.Builder>, AcknowledgeSegmentPackagerAccessor.AcknowledgeSegmentPackagerBuilder<StopAndWaitPacketInputStream.Builder>
Builder to build
StopAndWaitPacketInputStream
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns theStopAndWaitPacketInputStream
instance build according to theStopAndWaitPacketInputStream.Builder
configuration.withAcknowledgeMagicBytes
(byte[] aAcknowledgeMagicBytes) Sets the magic bytes for the acknowledge magic bytes property.withAcknowledgeRetryNumber
(int aAcknowledgeRetryNumber) Sets the number of retries for the acknowledge retry number.withAcknowledgeSegmentPackager
(SegmentPackager aAcknowledgeSegmentPackager) Sets theSegmentPackager
ACK property.withAcknowledgeTimeoutInMs
(long aAcknowledgeTimeoutInMs) Sets the number for the acknowledge timeout property.withChecksumValidationMode
(org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) withCrcAlgorithm
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm) withCrcChecksumConcatenateMode
(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) withPacketSegmentPackager
(SegmentPackager aPacketSegmentPackager) Sets theSegmentPackager
for the packetSegmentPackager
property.withReturnStream
(OutputStream aReturnStream) Sets the output return stream to use and returns this builder as of the Builder-Pattern.Methods inherited from class org.refcodes.serial.PacketInputStream.Builder
withBlockSize, withEndianess, withInputStream, withPacketLengthWidth, withPacketMagicBytes, withSequenceNumberConcatenateMode, withSequenceNumberInitValue, withSequenceNumberWidth
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.serial.AcknowledgeMagicBytesAccessor.AcknowledgeMagicBytesBuilder
withAcknowledgeMagicBytes, withAcknowledgeMagicBytes
Methods inherited from interface org.refcodes.serial.PacketMagicBytesAccessor.PacketMagicBytesBuilder
withPacketMagicBytes, withPacketMagicBytes
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
build
Returns theStopAndWaitPacketInputStream
instance build according to theStopAndWaitPacketInputStream.Builder
configuration.- Overrides:
build
in classPacketInputStream.Builder
- Returns:
- The accordingly configured
StopAndWaitPacketInputStream
.
-
withAcknowledgeMagicBytes
public StopAndWaitPacketInputStream.Builder withAcknowledgeMagicBytes(byte[] aAcknowledgeMagicBytes) Sets the magic bytes for the acknowledge magic bytes property.- Specified by:
withAcknowledgeMagicBytes
in interfaceAcknowledgeMagicBytesAccessor.AcknowledgeMagicBytesBuilder<StopAndWaitPacketInputStream.Builder>
- Parameters:
aAcknowledgeMagicBytes
- The magic bytes to be stored by the acknowledge magic bytes property.- Returns:
- The builder for applying multiple build operations.
-
withAcknowledgeRetryNumber
Sets the number of retries for the acknowledge retry number. A acknowledge retry number is the overall number of retries to use when counting retries.- Specified by:
withAcknowledgeRetryNumber
in interfaceAcknowledgeRetryNumberAccessor.AcknowledgeRetryNumberBuilder<StopAndWaitPacketInputStream.Builder>
- Parameters:
aAcknowledgeRetryNumber
- The number of retries to be stored by the number of acknowledge retry number.- Returns:
- The builder for applying multiple build operations.
-
withAcknowledgeSegmentPackager
public StopAndWaitPacketInputStream.Builder withAcknowledgeSegmentPackager(SegmentPackager aAcknowledgeSegmentPackager) Sets theSegmentPackager
ACK property.- Specified by:
withAcknowledgeSegmentPackager
in interfaceAcknowledgeSegmentPackagerAccessor.AcknowledgeSegmentPackagerBuilder<StopAndWaitPacketInputStream.Builder>
- Parameters:
aAcknowledgeSegmentPackager
- TheSegmentPackager
to be stored by theSegmentPackager
ACK property.- Returns:
- The builder for applying multiple build operations.
-
withAcknowledgeTimeoutInMs
public StopAndWaitPacketInputStream.Builder withAcknowledgeTimeoutInMs(long aAcknowledgeTimeoutInMs) Sets the number for the acknowledge timeout property.- Specified by:
withAcknowledgeTimeoutInMs
in interfaceAcknowledgeTimeoutInMsAccessor.AcknowledgeTimeoutInMsBuilder<StopAndWaitPacketInputStream.Builder>
- Parameters:
aAcknowledgeTimeoutInMs
- The acknowledge timeout in milliseconds to be stored by the acknowledge timeout property.- Returns:
- The builder for applying multiple build operations.
-
withCrcAlgorithm
public StopAndWaitPacketInputStream.Builder withCrcAlgorithm(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm) - Specified by:
withCrcAlgorithm
in interfaceorg.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<PacketInputStream.Builder>
- Overrides:
withCrcAlgorithm
in classPacketInputStream.Builder
-
withCrcChecksumConcatenateMode
public StopAndWaitPacketInputStream.Builder withCrcChecksumConcatenateMode(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) - Specified by:
withCrcChecksumConcatenateMode
in interfaceorg.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<PacketInputStream.Builder>
- Overrides:
withCrcChecksumConcatenateMode
in classPacketInputStream.Builder
-
withChecksumValidationMode
public StopAndWaitPacketInputStream.Builder withChecksumValidationMode(org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) - Specified by:
withChecksumValidationMode
in interfaceorg.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<PacketInputStream.Builder>
- Overrides:
withChecksumValidationMode
in classPacketInputStream.Builder
-
withPacketSegmentPackager
public StopAndWaitPacketInputStream.Builder withPacketSegmentPackager(SegmentPackager aPacketSegmentPackager) Sets theSegmentPackager
for the packetSegmentPackager
property.- Specified by:
withPacketSegmentPackager
in interfacePacketSegmentPackagerAccessor.PacketSegmentPackagerBuilder<PacketInputStream.Builder>
- Overrides:
withPacketSegmentPackager
in classPacketInputStream.Builder
- Parameters:
aPacketSegmentPackager
- TheSegmentPackager
to be stored by the packetSegmentPackager
property.- Returns:
- The builder for applying multiple build operations.
-
withReturnStream
Sets the output return stream to use and returns this builder as of the Builder-Pattern.- Specified by:
withReturnStream
in interfaceOutputReturnStreamAccessor.OutputReturnStreamBuilder<StopAndWaitPacketInputStream.Builder>
- Parameters:
aReturnStream
- The output return stream to be stored by the output return stream property.- Returns:
- This
OutputReturnStreamAccessor.OutputReturnStreamBuilder
instance to continue configuration.
-