yangtools.git
6 months agoUpdate tests 91/113891/2
Robert Varga [Tue, 8 Oct 2024 09:24:37 +0000 (11:24 +0200)]
Update tests

We are about to switch serialization proxies, update tests to show how
the format changes.

Change-Id: I6b448891519a374dc53a24fa48f1455b3c6078dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoBump odlparent to 14.0.4 85/113885/1
Robert Varga [Mon, 7 Oct 2024 19:59:41 +0000 (21:59 +0200)]
Bump odlparent to 14.0.4

Pick up latest upgrades from upstream.

Change-Id: Ic6a5e705dba9a390efbdd979c049a28e75997702
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 months agoFixup javadoc formatting 84/113884/1
Robert Varga [Mon, 7 Oct 2024 20:07:47 +0000 (22:07 +0200)]
Fixup javadoc formatting

Upgraded checkstyle is actually enforcing our Javadoc policy w.r.t.
<p> tag statement. Fix offending code.

Change-Id: I376834adf9139c885e94e116e905ae02b8445406
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump byte-buddy to 1.15.3 72/113772/1
Robert Varga [Tue, 1 Oct 2024 07:26:02 +0000 (09:26 +0200)]
Bump byte-buddy to 1.15.3

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.3

Change-Id: Ifdccd721735a883242a3caea85a159e9a1b76671
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump byte-buddy to 1.15.2 49/113749/1
Robert Varga [Fri, 27 Sep 2024 15:12:15 +0000 (17:12 +0200)]
Bump byte-buddy to 1.15.2

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.2

Change-Id: Ib02a9165a8d22462b0118e42abc47746b01ed451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoExpose BindingDataContainerWriter 19/113519/2
Robert Varga [Fri, 13 Sep 2024 14:50:02 +0000 (16:50 +0200)]
Expose BindingDataContainerWriter

We somehow lost the ability to emit stream events directly into a
NormalizedNodeStreamWriter. This patch restores it.

JIRA: YANGTOOLS-1648
Change-Id: Id8f517c3534ec2dc64c2046462648fab4e849cae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoBump Xtend to 2.36.0 31/113631/1
Robert Varga [Tue, 24 Sep 2024 07:46:14 +0000 (09:46 +0200)]
Bump Xtend to 2.36.0

https://eclipse.dev/Xtext/releasenotes.html#/releasenotes/2024/08/25/version-2-36-0

Change-Id: I404aa90b16a947475ed48782eaef93d80ece16ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoDefine a serialization proxy for yang.common.Empty 48/113548/1
Robert Varga [Tue, 17 Sep 2024 07:27:23 +0000 (09:27 +0200)]
Define a serialization proxy for yang.common.Empty

Empty's serial form is tied to its layout. This defines a serialization
proxy which can be used to disconnect it and provide forward
compatibility.

JIRA: YANGTOOLS-1647
Change-Id: Ie13d5907e1b94cd96b10dc25a3633139548f8209
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoDeprecate simple DataTreeFactory.create() 33/113533/1
Robert Varga [Mon, 16 Sep 2024 09:20:43 +0000 (11:20 +0200)]
Deprecate simple DataTreeFactory.create()

We cannot quite guarantee DataTree operation without an
EffectiveModelContext. This patch deprecates the simple method, steering
users towards method which require it.

Change-Id: I2b3f6c6802aed1892113e6d32c131a341a6323ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoAdd Uint{8,16,32,64} and Decimal64 serialization proxies 86/112186/6
Robert Varga [Sun, 16 Jun 2024 04:30:45 +0000 (06:30 +0200)]
Add Uint{8,16,32,64} and Decimal64 serialization proxies

Define serialization proxies for common types. This allows us to provide
compatibility with types serialized in future versions.

JIRA: YANGTOOLS-1647
Change-Id: I36a001a5af37c0c882e7fbb37e55ad379678b6e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoEliminate MutableTreeNode.setSubtreeVersion() 28/113528/1
Robert Varga [Sun, 15 Sep 2024 15:06:03 +0000 (17:06 +0200)]
Eliminate MutableTreeNode.setSubtreeVersion()

Each call to TreeNode.toMutable() is followed by a call to
setSubtreeVersion(). Push the subtree version into toMutable() directly,
making the code a tad more compact.

JIRA: YANGTOOLS-570
Change-Id: I6ab52715bd6678563263d928611f1a5737ac5533
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoRemove RpcInputCodec 18/113518/2
Robert Varga [Fri, 13 Sep 2024 14:40:01 +0000 (16:40 +0200)]
Remove RpcInputCodec

This interface used to have two unrelated implementations, but it only
has a single implementation now. Remove it to simplify things slightly.

Change-Id: I542e131e05f6a846ee1d8ba33d25e74744d9dc92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 months agoDataObjectCodecContext.serialize() should be final 17/113517/1
Robert Varga [Fri, 13 Sep 2024 14:38:46 +0000 (16:38 +0200)]
DataObjectCodecContext.serialize() should be final

We do not override this method anywhere, make sure to enforce it by
making it final.

Change-Id: Ia74c8625aca997e12ca80c046469dba1756d5818
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump versions to 14.0.5-SNAPSHOT 64/113364/1
Robert Varga [Mon, 2 Sep 2024 11:49:19 +0000 (13:49 +0200)]
Bump versions to 14.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: If0c33f3b32eed7e1b4050e6eb804507b1e145a62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRelease yangtools v14.0.4
jenkins-releng [Mon, 2 Sep 2024 09:42:42 +0000 (09:42 +0000)]
Release yangtools

8 months agoExpose org.opendaylight.yangtools.binding.data.codec.impl again 60/113360/1
Robert Varga [Mon, 2 Sep 2024 09:12:38 +0000 (11:12 +0200)]
Expose org.opendaylight.yangtools.binding.data.codec.impl again

This partially reverts 4c790297d02f82d750db09531f350b3ea813d287, so that
unit tests work.

JIRA: YANGTOOLS-1646
Change-Id: I477d4cbb1e45b6b0040831b101587e18cd5b2da8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump versions to 14.0.4-SNAPSHOT 47/113347/1
Robert Varga [Fri, 30 Aug 2024 19:17:53 +0000 (21:17 +0200)]
Bump versions to 14.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I2192feca61338309170ead196b79162ebe49af56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRelease yangtools v14.0.3
jenkins-releng [Fri, 30 Aug 2024 17:41:17 +0000 (17:41 +0000)]
Release yangtools

8 months agoBump odlparent to 14.0.3 44/113344/1
Robert Varga [Fri, 30 Aug 2024 16:48:52 +0000 (18:48 +0200)]
Bump odlparent to 14.0.3

Pick up latest updates.

Change-Id: Ib65cd95e46e8867da7d451888b95fca75f24eed1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump byte-buddy to 1.15.1 32/113332/1
Robert Varga [Fri, 30 Aug 2024 12:42:00 +0000 (14:42 +0200)]
Bump byte-buddy to 1.15.1

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.1

Change-Id: Ic780564d53b504190fc111b0cbb761af56057257
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump byte-buddy to 1.15.0 39/113239/1
Robert Varga [Sun, 25 Aug 2024 05:52:29 +0000 (07:52 +0200)]
Bump byte-buddy to 1.15.0

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.19
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.15.0

Change-Id: I734f095e9f397b113979a8863101e6d1ab375d07
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoImprove BindingClassLoader.toString() and equality 66/112966/4
Robert Varga [Thu, 1 Aug 2024 22:23:20 +0000 (00:23 +0200)]
Improve BindingClassLoader.toString() and equality

Improve BindingClassLoader.toString(), so that we:
- retain identity information, but use a consistent HexFormat string
- expose parent ClassLoader
- expose target from LeafBindingClassLoader

Also codify that a BindingClassLoader operates on object identity, so
there is no confusion about that fact, ever.

Change-Id: I1c9f968ff1e1bf4b4fc5b2a4a5dc64544f7ecfed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix compareAndExchange() check 52/112952/1
Robert Varga [Thu, 1 Aug 2024 18:51:04 +0000 (20:51 +0200)]
Fix compareAndExchange() check

The witness value should be checked against 'local', as that is what we
expect.

Change-Id: Ie4e264e0b978e2cc9557e01e23f8200a4fe4febc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoImprove RootBindingClassLoader logging 51/112951/1
Robert Varga [Thu, 1 Aug 2024 18:49:00 +0000 (20:49 +0200)]
Improve RootBindingClassLoader logging

Log isOurClass() exceptions on trace level to pollution. Add debugs
to point out which class loader we are using for which class.

Change-Id: I9f8eeab0e1fb222d2b40daba51eb7c86cf156d96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix a nullness warning in RootBindingClassLoader 50/112950/1
Robert Varga [Thu, 1 Aug 2024 18:41:42 +0000 (20:41 +0200)]
Fix a nullness warning in RootBindingClassLoader

We have local which we may end up returning not marked as @NonNull. Fix
that.

Change-Id: Idbf59b005c5c5e4b2816d4474966af804bb786ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDo not expose binding.data.codec.impl 44/112944/1
Robert Varga [Thu, 1 Aug 2024 11:01:44 +0000 (13:01 +0200)]
Do not expose binding.data.codec.impl

These are implementation internals and should not be accessible from
outside.

Change-Id: I2a17caa3818ee8b2df80735d55ec3315f858daf7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove BindingCodecTreeFactory 29/112929/3
Robert Varga [Wed, 31 Jul 2024 21:43:09 +0000 (23:43 +0200)]
Remove BindingCodecTreeFactory

This class has been superseded by binding.data.codec.dynamic version of
it. Remove if from binding-data-codec-api, making the codec API
independent of binding-runtime-api.

JIRAL YANGTOOLS-1638
Change-Id: I127102ce7d580771c2a3b9f0cb14c27843a42061
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd (Dynamic)BindingDataCodec et al. 25/112925/5
Robert Varga [Wed, 31 Jul 2024 18:53:57 +0000 (20:53 +0200)]
Add (Dynamic)BindingDataCodec et al.

We have BindingDOMCodecServices, which provides:
- a consistent set of binding-data-codec-api services
- a BindingRuntimeContext
- (indirectly) a EffectiveModelContext

The first item is a binding.data.codec.api concern, which is addressed
by exposing BindingDataCodec, which exposes the individual services. It
also takes care of the third item via an explicit modelContext() method,
as yang.model.api is implied in the services we provide.

The second item is the assumption of a dynamic runtime, where
BindingRuntimeContext is readily available. This is exposed via
binding.data.codec.dynamic.DynamicBindingDataCodec.

BindingDOMCodecServices are deprecated in favor of using one of these
interfaces.

We also introduce binding.data.codec.dynamic.BindingDataCodecFactory,
which supersedes binding.data.codec.spi.BindingDOMCodecFactory, as this
is an assumption of dynamism.

binding-data-codec-osgi now explicitly requires
binding-data-codec-dynamic, which is appropriate w.r.t. to assumption of
BindingRuntimeContext being passed around.

JIRA: YANGTOOLS-1638
Change-Id: I7d44063b42c3cddaa39c1c7a8aa28e035bb130a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBump byte-buddy to 1.14.18 58/112858/1
Robert Varga [Sun, 28 Jul 2024 21:03:48 +0000 (23:03 +0200)]
Bump byte-buddy to 1.14.18

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.14.18

Change-Id: I254abd8ce16277c191cd7c2dd93eba49aaca8916
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBump versions to 14.0.3-SNAPSHOT 57/112857/1
Robert Varga [Sun, 28 Jul 2024 13:43:37 +0000 (15:43 +0200)]
Bump versions to 14.0.3-SNAPSHOT

This starts the next development iteration.

Change-Id: I626563e5661e91245790c600f7ebce85f96a2dc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRelease yangtools v14.0.2
jenkins-releng [Sun, 28 Jul 2024 12:05:44 +0000 (12:05 +0000)]
Release yangtools

9 months agoConvert binding-loader to use bnd-parent 55/112855/1
Robert Varga [Sun, 28 Jul 2024 11:20:59 +0000 (13:20 +0200)]
Convert binding-loader to use bnd-parent

This is a nigh-trivial module, convert it to use bnd-parent. Also fixup
description a bit.

Change-Id: I35543143e4de825232c1ab8f6cfd6e8fae3c64f5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDo not specialize Grouping.implementedInterface() 51/112851/2
Robert Varga [Sun, 28 Jul 2024 08:33:09 +0000 (10:33 +0200)]
Do not specialize Grouping.implementedInterface()

Grouping is no longer a DataObject, hence its narrowed
implementedInterface() conflicts with DataObject when used in generic
type specification.

Do not narrow implementedInterface() in groupings.

JIRA: YANGTOOLS-1637
Change-Id: I3a907b2c6f8bc644d68a7aaf8efad3e56506081c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMigrate AbstractGeneratedTypeBuilderTest to JUnit5 99/112799/2
Robert Varga [Fri, 26 Jul 2024 12:31:29 +0000 (14:31 +0200)]
Migrate AbstractGeneratedTypeBuilderTest to JUnit5

Clean up the test and use assertThrows().

Change-Id: I5113578d105ee4ba99529ad3ecec2aa4eb5371e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBump versions to 14.0.2-SNAPSHOT 80/112780/1
Robert Varga [Thu, 25 Jul 2024 16:33:45 +0000 (18:33 +0200)]
Bump versions to 14.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia1a29d72598c0694b4819c5b16d53c956a9d5eaf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRelease yangtools v14.0.1
jenkins-releng [Thu, 25 Jul 2024 13:37:47 +0000 (13:37 +0000)]
Release yangtools

9 months agoBump odlparent to 14.0.2 66/112766/3
Robert Varga [Thu, 25 Jul 2024 10:54:49 +0000 (12:54 +0200)]
Bump odlparent to 14.0.2

Pick up latest updates from upstream.

Change-Id: Ia021695b9bab708f28296670ac22c2a86852be5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoConvert yang-data-api to bnd-parent 67/112767/1
Robert Varga [Thu, 25 Jul 2024 11:23:49 +0000 (13:23 +0200)]
Convert yang-data-api to bnd-parent

This is a straightforward conversion, with @Exports matching
module-info.

Change-Id: I77207d1a445da1da576a222684632cd6220e98f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix EnumerationTypeBuilder error message 53/112753/1
Robert Varga [Thu, 25 Jul 2024 07:49:48 +0000 (09:49 +0200)]
Fix EnumerationTypeBuilder error message

We have a bit of a messy error message here, fix it up to provide
complete information.

Change-Id: Ic39a69036d333216a6700618a22ece03dfccea48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoGrouping is a BindingObject 12/112612/2
Robert Varga [Wed, 17 Jul 2024 15:37:54 +0000 (17:37 +0200)]
Grouping is a BindingObject

Generated groupings are using just Grouping, not DataObject, which has
the unfortunate effect of not allowing them to be specified as caching
specification -- as those require BindingObject.

Restore this ability by making Grouping extend BindingObject.

JIRA: YANGTOOLS-1635
Change-Id: I51591cd9b6cbf1d2fe9659389e441613fdf3b310
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up binding-test-model tests 75/112575/2
Robert Varga [Tue, 16 Jul 2024 10:01:47 +0000 (12:01 +0200)]
Clean up binding-test-model tests

Modernize the tests a bit and hide them.

Change-Id: Ib6b9df83bc182194025aa65fbbbcc36849971c8e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agobinding.BaseIdentity is Serializable 74/112574/3
Robert Varga [Tue, 16 Jul 2024 09:42:15 +0000 (11:42 +0200)]
binding.BaseIdentity is Serializable

Objects implementing BaseIdentity are used as values, for example in
ScalarTypeObjects, which are Serializable.

Prior to MDSAL-733 we used Class<? extends BaseIdentity> to pass values
around, which meant we relied on java.lang.Class being Serializable.

Adjust BaseIdentity to extend Serializable and make generated VALUE
implementations properly resolve to singletons.

JIRA: YANGTOOLS-1633
Change-Id: Ic7b759c55bf9091639a983b56341c481632328eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBump versions to 14.0.1-SNAPSHOT 76/112576/1
Robert Varga [Tue, 16 Jul 2024 11:28:09 +0000 (13:28 +0200)]
Bump versions to 14.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia454315c6d5e1d8a8df95d754ac66d0e6d4844e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRelease yangtools v14.0.0
jenkins-releng [Tue, 16 Jul 2024 09:21:35 +0000 (09:21 +0000)]
Release yangtools

9 months agoMake sure list keys are final 73/112573/1
Robert Varga [Tue, 16 Jul 2024 08:29:49 +0000 (10:29 +0200)]
Make sure list keys are final

The class generated for a 'key' statement cannot be inherited, make sure
we mark it as final.

JIRA: YANGTOOLS-1632
Change-Id: Ic931143455a8baf2dd1089efc16fda6f5e56cc44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDo not generate QNAME constaints for Groupings 09/112509/6
Robert Varga [Tue, 9 Jul 2024 08:29:29 +0000 (10:29 +0200)]
Do not generate QNAME constaints for Groupings

QNAME constant is not really needed, as there is nothing on data
addressing side to do. Futhermore, since static members are 'inherited',
this ends up leading to some augmentations having a QNAME member.

Do not add the constant in GroupingGenerator and adjust tests to pick up
the namespace they need from a stable location.

JIRA: YANGTOOLS-1577
Change-Id: Ic03c0d6980317bb8042b482efd03fb9befb00283
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBump odlparent to 14.0.1 70/112570/1
Robert Varga [Mon, 15 Jul 2024 17:47:15 +0000 (19:47 +0200)]
Bump odlparent to 14.0.1

Pick up latest updates from upstream.

Change-Id: Id80f9997d53939a6aa1300f3422b3f6701d3159c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd DataObject{Identifier,Reference}.builder() static methods 69/112569/4
Robert Varga [Mon, 15 Jul 2024 17:05:40 +0000 (19:05 +0200)]
Add DataObject{Identifier,Reference}.builder() static methods

These methods mirror their YangInstanceIdentifier counterparts, but
route to alternative builders -- most notably
DataObjectIdentifier.Builder.

Attempting to use these is flushing a few bad things in builders, which
we also fix here.

JIRA: YANGTOOLS-1577
Change-Id: If09cdf49fdf924be3554e21e9064268b26fa1c5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAllow encoding to BindingInstanceIdentifier 64/112464/14
Robert Varga [Mon, 15 Jul 2024 12:32:22 +0000 (14:32 +0200)]
Allow encoding to BindingInstanceIdentifier

Add BindingInstanceIdentifierCodec.toBindingInstanceIdentifier(),
providing a bridge from YangInstanceIdentifier to
BindingInstanceIdentifier.

JIRA: YANGTOOLS-1577
Change-Id: Ic042ce98dd41d7ce44725e810310b844acf75f6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix BindingCodecContext.getSubtreeCodec() 67/112567/7
Robert Varga [Mon, 15 Jul 2024 13:58:29 +0000 (15:58 +0200)]
Fix BindingCodecContext.getSubtreeCodec()

The implementation of getSubtreeCodec() has a leaky overlap with
InstanceIdentifierCodec's requirements -- and hence not returning valid
contexts.

Introduce lookupCodecContext(), which can return any manner of
CodecContext, use that in getSubtreeCodec(). getCodecContextNode() is
then a further filter on lookupCodecContext().

JIRA: YANGTOOLS-1577
Change-Id: Ia11ffcde2f9a6ee29599c5e4a35e129bd06f08dd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove AbstractDataObjectCodecContext 68/112568/3
Robert Varga [Mon, 15 Jul 2024 15:42:51 +0000 (17:42 +0200)]
Remove AbstractDataObjectCodecContext

AbstractDataObjectCodecContext brings in bits of
CommonDataObjectCodecContext implementation into the picture, but it
really is its only specialization. Merge the two classes, adjusting
CodecDataObject accordingly.

JIRA: YANGTOOLS-1577
Change-Id: Iffe9b1981db6df974ab1a454f81aeaeca74c5656
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAllow ModuleRuntimeTypes to be looked up 66/112566/2
Robert Varga [Mon, 15 Jul 2024 14:22:05 +0000 (16:22 +0200)]
Allow ModuleRuntimeTypes to be looked up

We need the ability to lookup module root runtime type in order to
properly perform codec lookups -- for example when looking up a
top-level leaf.

JIRA: YANGTOOLS-1577
Change-Id: Ie2fd4b910d598b05c1d35bdb5489b8efb3f86bdb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAllow returning DataObjectReferences 65/112565/1
Robert Varga [Mon, 15 Jul 2024 12:05:03 +0000 (14:05 +0200)]
Allow returning DataObjectReferences

toBinding() promises a DataObjectReference, hence we can remove the
check for KeylessStep -- resulting in DataObjectReference.

JIRA: YANGTOOLS-1577
Change-Id: I342f5b8d815542b558b1d088162c95feb49f0ca1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFixup BindingInstanceIdentifierCodec 64/112564/1
Robert Varga [Mon, 15 Jul 2024 11:45:36 +0000 (13:45 +0200)]
Fixup BindingInstanceIdentifierCodec

The argument here should be final, fix that.

JIRA: YANGTOOLS-1577
Change-Id: I2312307b80db570eae33849d2403848c176514f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix XSD pattern specifics 65/111365/13
Peter Suna [Fri, 12 Apr 2024 08:22:16 +0000 (10:22 +0200)]
Fix XSD pattern specifics

Replace XSD multi character escape and substraction group pattern
with compatible Java regex.

Create a test to reproduce the issue with converting XSD patterns
into Java-compatible regex.

JIRA: YANGTOOLS-1571
Change-Id: Iab302638c3a436058f6de1d5dd5abd6e76fc411c
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
9 months agoUpdate InstanceNotification mapping 94/112494/13
Robert Varga [Mon, 8 Jul 2024 18:42:21 +0000 (20:42 +0200)]
Update InstanceNotification mapping

InstanceNotification is capturing its parent, which can reasonably be
Grouping, which is not a DataObject.

The situation is not dissimilar to that of RpcInput/RpcOutput for
actions. There we generate a data anchor at the place of definition for
wide reuse -- but generate an interface for each instantiation in
non-grouping.

In this case, though, we cannot generate a DataObject, as we are
inherently tied to an instance identifier.

We therefore go the 'like a grouping' route, generating a reusable
interface, which is then inherited by all concrete instantiations.

JIRA: YANGTOOLS-1577
Change-Id: I54383bc2fe1d060d20911861297ec59d49ddbfc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUse Grouping as fieldsFrom() argument 18/112518/2
Robert Varga [Tue, 9 Jul 2024 13:28:04 +0000 (15:28 +0200)]
Use Grouping as fieldsFrom() argument

fieldsFrom() is using DataObject, which has other implications than just
a grouping. Since we now have a dedicated construct, use that to mark
what is possible to pass down.

JIRA: YANGTOOLS-1577
Change-Id: If8ab18f26ac09ddc88cadc64fa4efddf15a821bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRefactor NotificationGenerator 04/112504/5
Robert Varga [Tue, 9 Jul 2024 03:21:26 +0000 (05:21 +0200)]
Refactor NotificationGenerator

We really have three generators in one. Let's properly specialize them
at instantiation. We will need this to generate more species of things.

JIRA: YANGTOOLS-1577
Change-Id: I2a7e2ab075464722ffe8458078966822da96b29e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUse a switch with patterns in AbstractCompositeGenerator 03/112503/3
Robert Varga [Tue, 9 Jul 2024 02:44:11 +0000 (04:44 +0200)]
Use a switch with patterns in AbstractCompositeGenerator

We have a plain cascade dispatch, use switch with patterns instead,
making things a tad cleaner.

JIRA: YANGTOOLS-1577
Change-Id: If96a34beb5e3ed3ab9947f7102330f19ff7aa501
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoSeparate out DataObjectIdentifier.Builder 02/112502/1
Robert Varga [Tue, 9 Jul 2024 01:56:41 +0000 (03:56 +0200)]
Separate out DataObjectIdentifier.Builder

This builder guarantees its result is a DataObjectIdentifier, as it
guards its contents from becoming wildcarded.

JIRA: YANGTOOLS-1577
Change-Id: I61b2bf5bc91bce24f02f6ef938b4c55f2a3bb33f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove DataTreeCandidateNodes.empty() 88/112488/1
Robert Varga [Mon, 8 Jul 2024 10:29:20 +0000 (12:29 +0200)]
Remove DataTreeCandidateNodes.empty()

An empty node does not make sense and is not used anywhere -- remove it.

JIRA: YANGTOOLS-1630
Change-Id: Ifc21888070e64a9dcb8f86485cf9018988b65b66
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd the ability to store versioning information 63/112163/4
Robert Varga [Fri, 14 Jun 2024 11:58:43 +0000 (13:58 +0200)]
Add the ability to store versioning information

Introduce data.tree.api.VersionIInfo and allow it to be attached to
internal version tracking during commit() time. This information can
be retried via DataTreeSnapshot.readVersionInfo().

JIRA: YANGTOOLS-1554
Change-Id: I26f78feec4c97bc488c3ddf5914cdc0a22b72eef
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd CandidateNode.Compacted 72/112472/2
Robert Varga [Sun, 7 Jul 2024 17:10:21 +0000 (19:10 +0200)]
Add CandidateNode.Compacted

A Compacted event indicates the underlying MVCC tracking data has been
prune. For most users this is just as Unmodified, but state replication
machines need to see this even separately.

JIRA: YANGTOOLS-1631
Change-Id: I9da0ccc06ba8c64f54dcffee9c25a657fa3d68be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoIntroduce DataTreeCandidate.CandidateNode 66/112466/6
Robert Varga [Sun, 7 Jul 2024 10:37:10 +0000 (12:37 +0200)]
Introduce DataTreeCandidate.CandidateNode

DataTreeCandidateNode's design dates back to Java 7 days, which shows in
its layout -- users need to understand behaviours implied by
ModificationType and do not get much other help.

This patch introduces CandidateNode, which is a sealed interface
exposing the bare basics and a number of non-sealed specializations to
handle all the different cases that may occur.

This allows users to use enhanced switch statements to differentiate
between the cases, working quite nicely with Java 21.

We also re-structure the SPI implementations to reduce confusion and
prepare for interop -- allowing us to share code via
AbstractDataeTreeCandidateNode.

Baseline implementations are explosed via
data.tree.spi.ImmutableCandidateNodes and its methods.

JIRA: YANGTOOLS-1630
Change-Id: I9f2cb5365f527acd9ecb1b684de2f09abe9083db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix OpaqueObject contract 63/112463/3
Robert Varga [Sat, 6 Jul 2024 16:05:27 +0000 (18:05 +0200)]
Fix OpaqueObject contract

OpaqueObject, while it represents a YANG modeled data tree, does not
expose its underlying structure -- and therefore it is not a
binding.DataContainer.

Promote OpaqueObject into a top-level BindingObject contract,
maintaining exposed implementedInterface(), without DataContainer
implication.

Furthermore do not capture ChildOf relationship in generated interfaces,
as that implies DataObject, again implying DataContainer -- and we do
not want that.

JIRA: YANGTOOLS-1577
Change-Id: Ic3baa0df23e7ca5642ca70624a2f6b6e0710b9d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd PropertyStep 62/112462/3
Robert Varga [Sat, 6 Jul 2024 13:00:45 +0000 (15:00 +0200)]
Add PropertyStep

PropertyStep identifies a terminal node in the DataContainer tree
structure -- i.e. something which is not a DataContainer. An
ExactPropertyStep is a valid BindingInstanceIdentifier.Step.

This also adds a PropertyIdentifier as a BindingInstanceIdentifier
subclass -- combinding a DataObjectIdentifier and a ExactPropertyStep.

This ends up almost completing the binding-spec level of changes, except
it highlights the problem that an OpaqueObject is a DataContainer: and
that should not be the case.

JIRA: YANGTOOLS-1577
Change-Id: Ia45cc327b4767d8317468ddef7b4c06f497c3d04
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoPromote ScalarTypeObject 59/112459/1
Robert Varga [Fri, 5 Jul 2024 21:10:12 +0000 (23:10 +0200)]
Promote ScalarTypeObject

ScalarTypeObject has passed its @Beta lifecycle, promote it to a stable
contract.

Change-Id: I871e7ddbc8ad4be46fc002e71b14b783dae1a241
JIRA: YANGTOOLS-1576
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAdd AbstractEntryObject 52/112452/7
Robert Varga [Fri, 5 Jul 2024 15:47:13 +0000 (17:47 +0200)]
Add AbstractEntryObject

Add AbstractEntryObject and teach codegen to take advantage of it in
generated EntryObject implementations. This lowers the number of
distinct implementations of KeyAware.key() contract, reducing boiler
plate code and hopefully helping the JVM a tiny bit.

JIRA: YANGTOOLS-1626
Change-Id: I27022ce385cc02431172f0bedd0cd68e29943ea7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRefactor key tracking 56/112456/1
Robert Varga [Fri, 5 Jul 2024 18:21:56 +0000 (20:21 +0200)]
Refactor key tracking

Make BuilderGenerator verify the returned type is a
GeneratedTransferObject. This allows us to remove a cast in
AbstractBuilderTemplate.

Also relocate key property extraction into AbstractBaseTemplate, where
we eschew creating a dedicated comparator.

JIRA: YANGTOOLS-1626
Change-Id: I6c28499f052b901289492108710a095f852b8814
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoEntryObject implies Augmentable 51/112451/8
Robert Varga [Fri, 5 Jul 2024 15:22:13 +0000 (17:22 +0200)]
EntryObject implies Augmentable

EntryObjects are always Augmentable, express that in the base interface
specification. We update BindingTypes.extractAugmentableTarget() to also
recognize this implication -- and extract the first from specialization.

JIRA: YANGTOOLS-1609
Change-Id: Ida98a65c18d6c608ec78c9cc8cd4ac9454e891d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRework Augmentation type extraction 54/112454/4
Robert Varga [Fri, 5 Jul 2024 17:07:42 +0000 (19:07 +0200)]
Rework Augmentation type extraction

Rather than relying on reflection and comparison of FQCN, expose the
appropriate BindingTypes method. This also drops @Beta annotation from
the two methods.

Change-Id: Ib4841e581d6152f32296913effef1fa8b7efbf41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoAbstractAugmentable is not @Beta 50/112450/3
Robert Varga [Fri, 5 Jul 2024 15:21:06 +0000 (17:21 +0200)]
AbstractAugmentable is not @Beta

Remove the annotation, as this is a fully-functional construct. Also
make sure we force users to implement their own
hashCode()/equals()/toString() methods.

JIRA: YANGTOOLS-1626
Change-Id: I2d2f981e3a828096d82d55de0791437cfdafe709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoUpdate KeyStep documentation 43/112443/3
Robert Varga [Thu, 4 Jul 2024 15:01:20 +0000 (17:01 +0200)]
Update KeyStep documentation

Reference EntryObject instead of KeyAware.

JIRA: YANGTOOLS-1577
Change-Id: I8500f4709d26f9bad5986da37e987474ad6f4374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not use KeyAware in BindingMap 42/112442/3
Robert Varga [Thu, 4 Jul 2024 14:59:52 +0000 (16:59 +0200)]
Do not use KeyAware in BindingMap

We are using EntryObjects, use key() method from there rather than from
KeyAware.

JIRA: YANGTOOLS-1577
Change-Id: Ib9cf83dfdbd3743f92bbfb38581eacae1ee58607
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove InstanceIdentifier.AbstractPathArgument 40/112440/2
Robert Varga [Thu, 4 Jul 2024 14:42:17 +0000 (16:42 +0200)]
Remove InstanceIdentifier.AbstractPathArgument

This class has been previously deprecated for removal and is no longer
used. Remove it.

JIRA: YANGTOOLS-1577
Change-Id: I3dca6be0c7b6d8099f01d6c19a5d68810313f4ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDeprecate yang.binding.InstanceIdentifier 39/112439/1
Robert Varga [Thu, 4 Jul 2024 14:39:52 +0000 (16:39 +0200)]
Deprecate yang.binding.InstanceIdentifier

This class is being replaced by DataObject{Reference,Identifier}, mark
this fact.

JIRA: YANGTOOLS-1577
Change-Id: I2c2e2f8cca2f73673be754d9226a236634b3669b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoBump odlparent to 14.0.0 35/112435/1
Robert Varga [Thu, 4 Jul 2024 10:49:34 +0000 (12:49 +0200)]
Bump odlparent to 14.0.0

Use a released version of odlparent again.

Change-Id: I0dbb78dcb2fe960bb0482de3703128f84c16d79a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix InstanceIdentifier.toReference() return 29/112429/1
Robert Varga [Wed, 3 Jul 2024 09:33:10 +0000 (11:33 +0200)]
Fix InstanceIdentifier.toReference() return

Guarantee a non-null object here.

JIRA: YANGTOOLS-1577
Change-Id: I0d4361c36ea7eb7b50523f61215b48a5aad45e1a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up Sonar warnings 21/112421/2
Robert Varga [Tue, 2 Jul 2024 14:44:41 +0000 (16:44 +0200)]
Clean up Sonar warnings

This makes a pass at fixing up minor issues reported by Sonar.

JIRA: YANGTOOLS-1576
Change-Id: I629b2504d374310965fa92bbfc4ea1d23d4b0935
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFixup binding-bundle-parent reference 23/112423/1
Robert Varga [Tue, 2 Jul 2024 15:38:41 +0000 (17:38 +0200)]
Fixup binding-bundle-parent reference

We need to also use the correct artifactId, not just the path.

Change-Id: I76d4f99e89c4c6bb390aeda6bfdc4ab238ff4166
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoIntroduce BindingInstanceIdentifier.Step 19/112419/1
Robert Varga [Tue, 2 Jul 2024 13:52:07 +0000 (15:52 +0200)]
Introduce BindingInstanceIdentifier.Step

The identifier is composed a number of steps -- just as exposed from
DataObjectIdentifier, but slightly more general.

JIRA: YANGTOOLS-1577
Change-Id: I14d808664a11a3ea144af65df0f6ab3c467e3358
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSharpen ChildOf type argument 18/112418/1
Robert Varga [Tue, 2 Jul 2024 13:46:46 +0000 (15:46 +0200)]
Sharpen ChildOf type argument

ChildOf's parent cannot be any old Object, it has to be a DataContainer
-- improving usage safety.

JIRA: YANGTOOLS-1577
Change-Id: I024247b40b9209ef980759fe7eba8d0e504a9bc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up binding-model stuff a bit 98/112398/1
Robert Varga [Sun, 30 Jun 2024 13:49:11 +0000 (15:49 +0200)]
Clean up binding-model stuff a bit

Re-introduce mockito-configuration and reorder module-info.java
references.

JIRA: YANGTOOLS-1576
Change-Id: Idde312f750f6865551a28a14b7fecd66e3d51709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMerge binding-model-{api,ri} 89/112389/3
Robert Varga [Sun, 30 Jun 2024 09:10:10 +0000 (11:10 +0200)]
Merge binding-model-{api,ri}

Splitting model-api from model-ri does not make much sense at this
point. Merge the two into binding-model, which properly depends on
binding-spec, just as model-ri used to.

JIRA: YANGTOOLS-1576
Change-Id: I13d5c592b6b60edcc264d9885376f83a2ccb9368
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRename binding-parent to binding-bundle-parent 96/112396/1
Robert Varga [Sun, 30 Jun 2024 12:46:35 +0000 (14:46 +0200)]
Rename binding-parent to binding-bundle-parent

We are going to have a 'binding-bnd-parent', so let's keep consistent
naming here.

JIRA: YANGTOOLS-1576
Change-Id: I267a62a20f5e4f6ab4f3610521058956d08eff3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRemove yang-ext 95/112395/1
Robert Varga [Sun, 30 Jun 2024 12:43:35 +0000 (14:43 +0200)]
Remove yang-ext

The bits of yang-ext.yang that are relevant to yangtools have been split
out to odl-codegen-extensions.yang. Remove this packaging.

JIRA: YANGTOOLS-1576
Change-Id: Ied18a3eb3360707ce4f1c8d5f5bb13e5324c1ede
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoDo not declare binding-parent 94/112394/1
Robert Varga [Sun, 30 Jun 2024 12:41:20 +0000 (14:41 +0200)]
Do not declare binding-parent

binding-parent is an entry point into yangtools, just as artifacts
does. Do not declarete it in artifacts.

JIRA: YANGTOOLS-1576
Change-Id: Ia9efb6c0f58f2d3cc4a47017405b513d5e8e559d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrade binding-reflect to bnd-parent 93/112393/1
Robert Varga [Sun, 30 Jun 2024 12:21:18 +0000 (14:21 +0200)]
Migrade binding-reflect to bnd-parent

Modernize the packaging method, using explict Export annotation.

JIRA: YANGTOOLS-1576
Change-Id: I1b4ee2c2fbdc38d0851b6acc545e3ce9bf753a8e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoImprove binding-codegen tests 92/112392/2
Robert Varga [Sun, 30 Jun 2024 12:13:20 +0000 (14:13 +0200)]
Improve binding-codegen tests

Remove uneeded exception throws, turning them into assertion failures.

JIRA: YANGTOOLS-1576
Change-Id: Ic1ee8b17df995e33fd9ee821e677ceaa22bd26bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrate binding-{reflect,spec} to JUni5 91/112391/2
Robert Varga [Sun, 30 Jun 2024 11:41:59 +0000 (13:41 +0200)]
Migrate binding-{reflect,spec} to JUni5

Migrate and modernize tests, improving assertions a bit.

JIRA: YANGTOOLS-1576
Change-Id: Id29dfe2b8c1c1ca78639bd9a12aebad905d5831e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up TypeMemberComment 88/112388/2
Robert Varga [Sun, 30 Jun 2024 08:55:32 +0000 (10:55 +0200)]
Clean up TypeMemberComment

We have a javadoc warning and an opporunity to simplify equals().

Change-Id: I5cf610d44f89f4b97ef272f09444f5104dfa46a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRework Grouping mapping 85/112385/5
Robert Varga [Sat, 29 Jun 2024 13:45:33 +0000 (15:45 +0200)]
Rework Grouping mapping

Having interfaces generated for grouping extend DataObject brings in
a lot of chaos, as it implies Grouping is addressable, which it is not.

We have a lower-impact contract, DataContainer, which gives similar
facilities, but is does not imply the interface can be used in
DataObjectStep.

Introduce binding.Grouping as a DataContainer specialization and switch
interfaces generated for groupings to use that.

JIRA: YANGTOOLS-1577
Change-Id: I9c63400281098a25974feb46ae33101793f3248b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoRefactor binding.DataRoot 86/112386/2
Robert Varga [Sat, 29 Jun 2024 14:52:52 +0000 (16:52 +0200)]
Refactor binding.DataRoot

DataRoot is really a (currently unaddressable) DataContainer. Make it
generic, forcing specialization, and extend DataContainer.

This ends up cleaning up some sites, which are using generic capture
<R extends DataRoot & DataObject> to express a generated type -- those
now become <R extends DataRoot<R>>.

We also get the goodies of terminal specialization like OpaqueObject,
like an accurate implementedInterface().

JIRA: YANGTOOLS-1577
Change-Id: Ie37fad4b7274e06dbf412c6d3a1cee3d6a6c98c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoMigrate DefaultBindingGeneratorTest 84/112384/1
Robert Varga [Sat, 29 Jun 2024 14:04:34 +0000 (16:04 +0200)]
Migrate DefaultBindingGeneratorTest

Use JUnit5, ditching MockitoExtension, as it is not used. Also migrate
away from Hamcrest, as JUnit5 provides everything we need.

Change-Id: I2bb59dac4c8a9cb0842d393fa8b79647b4952bbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up use of Augmentation generics 82/112382/1
Robert Varga [Sat, 29 Jun 2024 11:31:01 +0000 (13:31 +0200)]
Clean up use of Augmentation generics

Augmentation is a subclass of DataObject, therefore we do not need to
use a generic & DataObject.

Change-Id: I477389347b0a082c04ea2d9a63e6d4e0db6d23f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoClean up binding-spec use of EntryObject 81/112381/1
Robert Varga [Sat, 29 Jun 2024 11:24:37 +0000 (13:24 +0200)]
Clean up binding-spec use of EntryObject

We have a few leftovers referencing either KeyAware or unnecessarily
mixing in DataObject. Clean all of them up.

JIRA: YANGTOOLS-1609
Change-Id: I8d25ae590a17bdffa4f0c9fa2270976ec86afabc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoSimplify BindingStreamEventWriter 80/112380/1
Robert Varga [Sat, 29 Jun 2024 11:17:13 +0000 (13:17 +0200)]
Simplify BindingStreamEventWriter

Since we have EntryObject we can improve a few method signatures, as it
captures the KeyAware/DataObject base.

JIRA: YANGTOOLS-1609
Change-Id: Ibea61933108ca0941c0a20029bce2ad5cf10dc19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoFix union treatment of instance-identifier 79/112379/1
Robert Varga [Sat, 29 Jun 2024 10:01:36 +0000 (12:01 +0200)]
Fix union treatment of instance-identifier

Fix the stringValue() detection logic to recognize
BindingInstanceIdentifier.

JIRA: YANGTOOLS-1577
Change-Id: I8dd80fc1fa4c22fbac0d76083994e034c8b95532
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoIntroduce binding.EntryObject 68/112368/6
Robert Varga [Fri, 28 Jun 2024 17:29:07 +0000 (19:29 +0200)]
Introduce binding.EntryObject

We are using KeyAware with conjunction with DataObject, leaving
generated code to connect the two. This is unfortunate, as that
conjuction is really a kind of DataObject, similar to ChildOf.

Introduce a dedicated type, EntryObject, which combines DataObject and
KeyAware, providing a nice marker for generated interfaces. This also
allows us to further specialize KeyAware and seal its class hierarchy,
reducing potential confusion.

JIRA: YANGTOOLS-1609
Change-Id: I11a1d1c678c5e7f4397d1a2ddf420067559b2dbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 months agoImprove data codec dispatch 71/112371/4
Robert Varga [Fri, 28 Jun 2024 22:15:38 +0000 (00:15 +0200)]
Improve data codec dispatch

Isolate everything except Object.class, so that we properly look up
pass-through types. This leaves NOOP_CODEC relying at least on
BuiltInTypes, although that is not a complete solution.

JIRA: YANGTOOLS-1602
Change-Id: Ic46328d47924910dc425f50b5cd77ca1bb111b31
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>