java.lang.Object
org.refcodes.serial.PacketInputStream.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>
,PacketLengthWidthAccessor.PacketLengthWidthBuilder<PacketInputStream.Builder>
,PacketMagicBytesAccessor.PacketMagicBytesBuilder<PacketInputStream.Builder>
,PacketSegmentPackagerAccessor.PacketSegmentPackagerBuilder<PacketInputStream.Builder>
,SequenceNumberConcatenateModeAccessor.SequenceNumberConcatenateModeBuilder<PacketInputStream.Builder>
,SequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<PacketInputStream.Builder>
,SequenceNumberWidthAccessor.SequenceNumberWidthBuilder<PacketInputStream.Builder>
- Direct Known Subclasses:
StopAndWaitPacketInputStream.Builder
- Enclosing class:
- PacketInputStream
public static class PacketInputStream.Builder
extends Object
implements SequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<PacketInputStream.Builder>, SequenceNumberWidthAccessor.SequenceNumberWidthBuilder<PacketInputStream.Builder>, org.refcodes.mixin.BlockSizeAccessor.BlockSizeBuilder<PacketInputStream.Builder>, org.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<PacketInputStream.Builder>, org.refcodes.numerical.EndianessAccessor.EndianessBuilder<PacketInputStream.Builder>, SequenceNumberConcatenateModeAccessor.SequenceNumberConcatenateModeBuilder<PacketInputStream.Builder>, PacketSegmentPackagerAccessor.PacketSegmentPackagerBuilder<PacketInputStream.Builder>, org.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<PacketInputStream.Builder>, org.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<PacketInputStream.Builder>, org.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<PacketInputStream.Builder>, PacketLengthWidthAccessor.PacketLengthWidthBuilder<PacketInputStream.Builder>, PacketMagicBytesAccessor.PacketMagicBytesBuilder<PacketInputStream.Builder>
Builder to build
PacketInputStream
instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns thePacketInputStream
instance build according to thePacketInputStream.Builder
configuration.withBlockSize
(int aBlockSize) withChecksumValidationMode
(org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) withCrcAlgorithm
(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm) withCrcChecksumConcatenateMode
(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) withEndianess
(org.refcodes.numerical.Endianess aEndianess) withInputStream
(InputStream aInputStream) withPacketLengthWidth
(int aPacketLengthWidth) Sets the packet length width (in bytes) for the packet length width (in bytes) property.withPacketMagicBytes
(byte[] aPacketMagicBytes) Sets the magic bytes for the packet magic bytes property.withPacketSegmentPackager
(SegmentPackager aPacketSegmentPackager) Sets theSegmentPackager
for the packetSegmentPackager
property.withSequenceNumberConcatenateMode
(org.refcodes.mixin.ConcatenateMode aSequenceNumberConcatenateMode) Sets theConcatenateMode
for the sequence numberConcatenateMode
property.withSequenceNumberInitValue
(int aSequenceNumberInitValue) Sets the sequence number initial value for the sequence number initial value property.withSequenceNumberWidth
(int aSequenceNumberWidth) Sets the sequence number width (in bytes) for the sequence number width (in bytes) property.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.PacketMagicBytesAccessor.PacketMagicBytesBuilder
withPacketMagicBytes, withPacketMagicBytes
-
Method Details
-
build
Returns thePacketInputStream
instance build according to thePacketInputStream.Builder
configuration.- Returns:
- The accordingly configured
PacketInputStream
.
-
withBlockSize
- Specified by:
withBlockSize
in interfaceorg.refcodes.mixin.BlockSizeAccessor.BlockSizeBuilder<PacketInputStream.Builder>
-
withCrcAlgorithm
public PacketInputStream.Builder withCrcAlgorithm(org.refcodes.numerical.CrcAlgorithm aCrcAlgorithm) - Specified by:
withCrcAlgorithm
in interfaceorg.refcodes.numerical.CrcAlgorithmAccessor.CrcAlgorithmBuilder<PacketInputStream.Builder>
-
withCrcChecksumConcatenateMode
public PacketInputStream.Builder withCrcChecksumConcatenateMode(org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode) - Specified by:
withCrcChecksumConcatenateMode
in interfaceorg.refcodes.numerical.CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<PacketInputStream.Builder>
-
withChecksumValidationMode
public PacketInputStream.Builder withChecksumValidationMode(org.refcodes.numerical.ChecksumValidationMode aChecksumValidationMode) - Specified by:
withChecksumValidationMode
in interfaceorg.refcodes.numerical.ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<PacketInputStream.Builder>
-
withEndianess
- Specified by:
withEndianess
in interfaceorg.refcodes.numerical.EndianessAccessor.EndianessBuilder<PacketInputStream.Builder>
-
withInputStream
- Specified by:
withInputStream
in interfaceorg.refcodes.mixin.InputStreamAccessor.InputStreamBuilder<PacketInputStream.Builder>
-
withPacketMagicBytes
Sets the magic bytes for the packet magic bytes property.- Specified by:
withPacketMagicBytes
in interfacePacketMagicBytesAccessor.PacketMagicBytesBuilder<PacketInputStream.Builder>
- Parameters:
aPacketMagicBytes
- The magic bytes to be stored by the packet magic bytes property.- Returns:
- The builder for applying multiple build operations.
-
withPacketSegmentPackager
Sets theSegmentPackager
for the packetSegmentPackager
property.- Specified by:
withPacketSegmentPackager
in interfacePacketSegmentPackagerAccessor.PacketSegmentPackagerBuilder<PacketInputStream.Builder>
- Parameters:
aPacketSegmentPackager
- TheSegmentPackager
to be stored by the packetSegmentPackager
property.- Returns:
- The builder for applying multiple build operations.
-
withSequenceNumberConcatenateMode
public PacketInputStream.Builder withSequenceNumberConcatenateMode(org.refcodes.mixin.ConcatenateMode aSequenceNumberConcatenateMode) Sets theConcatenateMode
for the sequence numberConcatenateMode
property.- Specified by:
withSequenceNumberConcatenateMode
in interfaceSequenceNumberConcatenateModeAccessor.SequenceNumberConcatenateModeBuilder<PacketInputStream.Builder>
- Parameters:
aSequenceNumberConcatenateMode
- TheConcatenateMode
to be stored by the sequence numberConcatenateMode
property.- Returns:
- The builder for applying multiple build operations.
-
withSequenceNumberInitValue
Sets the sequence number initial value for the sequence number initial value property.- Specified by:
withSequenceNumberInitValue
in interfaceSequenceNumberInitValueAccessor.SequenceNumberInitValueBuilder<PacketInputStream.Builder>
- Parameters:
aSequenceNumberInitValue
- The sequence number initial value to be stored by the sequence number initial value property.- Returns:
- The builder for applying multiple build operations.
-
withSequenceNumberWidth
Sets the sequence number width (in bytes) for the sequence number width (in bytes) property.- Specified by:
withSequenceNumberWidth
in interfaceSequenceNumberWidthAccessor.SequenceNumberWidthBuilder<PacketInputStream.Builder>
- Parameters:
aSequenceNumberWidth
- The sequence number width (in bytes) to be stored by the sequence number width (in bytes) property.- Returns:
- The builder for applying multiple build operations.
-
withPacketLengthWidth
Sets the packet length width (in bytes) for the packet length width (in bytes) property.- Specified by:
withPacketLengthWidth
in interfacePacketLengthWidthAccessor.PacketLengthWidthBuilder<PacketInputStream.Builder>
- Parameters:
aPacketLengthWidth
- The packet length width (in bytes) to be stored by the packet length width (in bytes) property.- Returns:
- The builder for applying multiple build operations.
-