With the recent changes to message identifier set it’s no longer possible to access the range count, but we’d only ever need that to calculate isContiguous. Moving this into NIOIMAPCore seems like the better approach.
Due to all the changes to create generic types a lot of the types specified in various bits of documentation were actually wrong. They've been fixed.
Also delete a redundant duplicate function writeUID
Note - I'll update documentation in a follow-up PR
Remove SequenceRange and SequenceRangeSet and replace with new MessageIdentifier* types.
Motivation:
There was lots of very complicated duplicate code, and there was about to be more if we didn't make the new MessageIdentifier types.
Modifications:
Replace basically every occurrence of SequenceRange with MessageIdentifierRange<SequenceNumber> and SequenceRangeSet with MessageIdentifierSet<SequenceRangeNumber>.
Result:
Lots of lines deleted.
In a previous PR we made UID conform to a new protocol MessageIdentifier. This PR continues the trend of removing concrete types and replacing them with generic types.
In this case we have UIDSet and UIDSetNonEmpty. These are identical to SequenceNumberSet and SequenceNumberSetNonEmpty. To allow us to remove the duplicate code a new generic type MessageIdentifierSet has been defined that takes a generic parameter T: MessageIdentifier. Both UID and SequenceNumber conform to MessageIdentifier.
In the next PR I will remove the code for SequenceNumberSet* and replace with MessageIdentifierSet. This PR only addresses the UIDSet* types.
Note: I will update all documentation in another (probably the last) PR.