BUG-6028: iterate over component types to instantiate union 56/40056/13
authorRobert Varga <rovarga@cisco.com>
Wed, 8 Jun 2016 16:31:40 +0000 (18:31 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Mon, 18 Jul 2016 12:34:35 +0000 (12:34 +0000)
commit9689b0feea2df7d3737295daa738869cff8fbc42
tree3c86698858bcd2375604243188cae4f2b77cd173
parent3cc5b499ff34e221b247409530321ed02ebca03f
BUG-6028: iterate over component types to instantiate union

This reworks union instantiation to be on par with
https://tools.ietf.org/html/rfc6020#section-9.12. We iterate
over individual members and attempt to run deserialization.

If it succeeds instantiate the union using cached constructor
specifying that member. This side-steps the need to go through
serialization.

Change-Id: Ieec37da37a05c2b2a2f432778232e136c903f654
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/UnionTypeCodec.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/UnionValueOptionContext.java
binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/yangtools/binding/data/codec/impl/UnionValueOptionContextTest.java