java.lang.Object
org.refcodes.numerical.AbstractCrcMixin
- All Implemented Interfaces:
ChecksumValidationModeAccessor,CrcAlgorithmAccessor,CrcChecksumConcatenateModeAccessor,CrcMixin,EndianessAccessor
A
AbstractCrcMixin provides a class based implementation of the
CrcMixin for CRC checksum creation and validation of accompanied
data.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.numerical.ChecksumValidationModeAccessor
ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<B extends ChecksumValidationModeAccessor.ChecksumValidationModeBuilder<B>>, ChecksumValidationModeAccessor.ChecksumValidationModeMutator, ChecksumValidationModeAccessor.ChecksumValidationModePropertyNested classes/interfaces inherited from interface org.refcodes.numerical.CrcAlgorithmAccessor
CrcAlgorithmAccessor.CrcAlgorithmBuilder<B extends CrcAlgorithmAccessor.CrcAlgorithmBuilder<B>>, CrcAlgorithmAccessor.CrcAlgorithmMutator, CrcAlgorithmAccessor.CrcAlgorithmPropertyNested classes/interfaces inherited from interface org.refcodes.numerical.CrcChecksumConcatenateModeAccessor
CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<B extends CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeBuilder<B>>, CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModeMutator, CrcChecksumConcatenateModeAccessor.CrcChecksumConcatenateModePropertyNested classes/interfaces inherited from interface org.refcodes.numerical.EndianessAccessor
EndianessAccessor.EndianessBuilder<B extends EndianessAccessor.EndianessBuilder<B>>, EndianessAccessor.EndianessMutator, EndianessAccessor.EndianessProperty -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChecksumValidationModeprotected CrcAlgorithmprotected org.refcodes.mixin.ConcatenateModeprotected Endianess -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCrcMixin(CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, ChecksumValidationMode aChecksumValidationMode, Endianess aEndianess) Constructs an according instance from the given arguments. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieves the validation mode from the validation mode property.Retrieves the value from theCrcAlgorithmproperty.org.refcodes.mixin.ConcatenateModeRetrieves theConcatenateModefrom the CRC checksumConcatenateModeproperty.Retrieves the value from theEndianessproperty.inthashCode()
-
Field Details
-
_crcAlgorithm
-
_checksumValidationMode
-
_crcChecksumConcatenateMode
protected org.refcodes.mixin.ConcatenateMode _crcChecksumConcatenateMode -
_endianess
-
-
Constructor Details
-
AbstractCrcMixin
public AbstractCrcMixin(CrcAlgorithm aCrcAlgorithm, org.refcodes.mixin.ConcatenateMode aCrcChecksumConcatenateMode, ChecksumValidationMode aChecksumValidationMode, Endianess aEndianess) Constructs an according instance from the given arguments.- Parameters:
aCrcAlgorithm- TheCrcAlgorithmto be used for CRC checksum calculation.aCrcChecksumConcatenateMode- The mode of concatenation to use when enriching data with a CRC checksum.aChecksumValidationMode- The mode of operation when validating provided CRC checksums against calculated ones.aEndianess- TheEndianessto use when calculating the CRC checksum.
-
-
Method Details
-
getCrcChecksumConcatenateMode
public org.refcodes.mixin.ConcatenateMode getCrcChecksumConcatenateMode()Retrieves theConcatenateModefrom the CRC checksumConcatenateModeproperty.- Specified by:
getCrcChecksumConcatenateModein interfaceCrcChecksumConcatenateModeAccessor- Returns:
- The
ConcatenateModestored by the CRC checksumConcatenateModeproperty.
-
getChecksumValidationMode
Retrieves the validation mode from the validation mode property.- Specified by:
getChecksumValidationModein interfaceChecksumValidationModeAccessor- Returns:
- The validation mode stored by the validation mode property.
-
getCrcAlgorithm
Retrieves the value from theCrcAlgorithmproperty.- Specified by:
getCrcAlgorithmin interfaceCrcAlgorithmAccessor- Returns:
- The name stored by the
CrcAlgorithmproperty.
-
getEndianess
Retrieves the value from theEndianessproperty.- Specified by:
getEndianessin interfaceEndianessAccessor- Returns:
- The name stored by the
Endianessproperty.
-
hashCode
public int hashCode() -
equals
-