CDM has several usages where enums are extended, however this is not supported in Java (comparisons don't work properly)
enum EntityIdentifierTypeEnum extends PartyIdentifierTypeEnum:
REDID
CountryCode
Other
enum PartyIdentifierTypeEnum:
BIC
LEI
MIC
Choice types can be used as an alternative to enum extension
enum EntityIdentifierTypeEnum: <"No longer extends PartyIdentifierTypeEnum">
REDID
CountryCode
Other
enum PartyIdentifierTypeEnum:
BIC
LEI
MIC
choice PartyOrEntityIdentifierType:
EntityIdentifierTypeEnum
PartyIdentifierTypeEnum
Where comparison of choice type to choice options is allowed
func IsBicOrRedId:
inputs:
assetIdentifier PartyOrEntityIdentifierType (0..1)
output:
result boolean (0..1)
set result:
assetIdentifier = PartyIdentifierTypeEnum -> BIC or assetIdentifier = EntityIdentifierTypeEnum -> REDID
- Comparison of choice type to choice options should be allowed for types (not just enums)
- Make the usage of enum extended a warning, and in future an error
CDM has several usages where enums are extended, however this is not supported in Java (comparisons don't work properly)
Choice types can be used as an alternative to enum extension
Where comparison of choice type to choice options is allowed