Details
-
New Feature
-
Status: Confirmed
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
Description
Union values are a nasty beast, as they are polymorphic and do not really have a native type. RFC6020(bis) maps their type to the first conforming member, which means each time we want to instantiate a union DTO (in Java Bindings, but this is not specific to them), we have to check each possibility until we find a match. This is especially troublesome unions of exotic types like binary, where the cost of getting the common representation cost quite a few CPU cycles.
Introduce a dedicated value class for use with union types, which aside from the value in native type will hold the SchemaPath of the type being stored. It needs to be exposed as an Optional<SchemaPath> for compatibility with schema-less producers.
This would probably be also beneficial for String types, where we get it trouble with Binding subclasses.
Attachments
Issue Links
- blocks
-
YANGTOOLS-675 [Yang 1.1] Allow type "leafref" in unions
- Confirmed