Reduce use of BindingReflections in BindingNormalizedNodeSerializer 04/106704/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Jun 2023 18:16:25 +0000 (20:16 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 26 Jun 2023 18:47:50 +0000 (20:47 +0200)
BindingNormalizedNodeSerializer's codec implementation can easily
process some of these methods and we therefore do not have to use
BindingReflections to acquire their NodeIdentifiers.

JIRA: MDSAL-781
Change-Id: If928d896e785fe8782ddbde7fb898464c40adb17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-codec-api/src/main/java/org/opendaylight/mdsal/binding/dom/codec/api/BindingNormalizedNodeSerializer.java

index 46663d22c99b76798d3a8fea2086b7cb286c0b32..a3ce9deeaae14b7d57ef357d84af3c2c86811eed 100644 (file)
@@ -240,7 +240,8 @@ public interface BindingNormalizedNodeSerializer {
      * @return NormalizedNode representation of action input
      * @throws NullPointerException if any of the arguments is null
      */
-    @Beta default @NonNull BindingLazyContainerNode<RpcInput> toLazyNormalizedNodeActionInput(
+    @Beta
+    default @NonNull BindingLazyContainerNode<RpcInput> toLazyNormalizedNodeActionInput(
             @NonNull final Class<? extends Action<?, ?, ?>> action, @NonNull final RpcInput input) {
         return toLazyNormalizedNodeActionInput(action,
             new NodeIdentifier(YangConstants.operationInputQName(BindingReflections.getQNameModule(action))), input);
@@ -254,12 +255,9 @@ public interface BindingNormalizedNodeSerializer {
      * @return NormalizedNode representation of action input
      * @throws NullPointerException if any of the arguments is null
      */
-    @Beta default @NonNull ContainerNode toNormalizedNodeActionInput(
-            @NonNull final Class<? extends Action<?, ?, ?>> action, @NonNull final RpcInput input) {
-        return toLazyNormalizedNodeActionInput(action,
-            new NodeIdentifier(YangConstants.operationInputQName(BindingReflections.getQNameModule(action))), input)
-                .getDelegate();
-    }
+    @Beta
+    @NonNull ContainerNode toNormalizedNodeActionInput(@NonNull Class<? extends Action<?, ?, ?>> action,
+        @NonNull RpcInput input);
 
     /**
      * Lazily translates supplied Binding action output into NormalizedNode data.
@@ -292,10 +290,7 @@ public interface BindingNormalizedNodeSerializer {
      * @param output Binding action output
      * @return NormalizedNode representation of action output
      */
-    @Beta default @NonNull ContainerNode toNormalizedNodeActionOutput(
-            @NonNull final Class<? extends Action<?, ?, ?>> action, @NonNull final RpcOutput output) {
-        return toLazyNormalizedNodeActionOutput(action,
-            new NodeIdentifier(YangConstants.operationOutputQName(BindingReflections.getQNameModule(action))), output)
-                .getDelegate();
-    }
+    @Beta
+    @NonNull ContainerNode toNormalizedNodeActionOutput(@NonNull Class<? extends Action<?, ?, ?>> action,
+        @NonNull RpcOutput output);
 }