Specialize JSONCodec to Void input 60/111160/4
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 1 Apr 2024 18:36:39 +0000 (20:36 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 3 Jun 2024 16:38:19 +0000 (18:38 +0200)
We do not take any input, not some vague Object. Specialize to
java.lang.Void, of which there is only the null instance.

JIRA: YANGTOOLS-1568
Change-Id: Ia7cda3f485b07d56b9986f689635fbcca1025a65
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONCodec.java

index 3416feee3a67ba0dfdf9be8d6eafdced7b967165..b4dd7336b93e07677e12cb5911094fa06f28b0bf 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.yangtools.yang.data.util.codec.TypeAwareCodec;
  *
  * @param <T> Normalized value type
  */
-public sealed interface JSONCodec<T> extends TypeAwareCodec<T, Object, JsonWriter>
+public sealed interface JSONCodec<T> extends TypeAwareCodec<T, Void, JsonWriter>
         permits AbstractJSONCodec, EmptyJSONCodec, IdentityrefJSONCodec, InstanceIdentifierJSONCodec, UnionJSONCodec {
     /**
      * {@inheritDoc}.
@@ -47,7 +47,7 @@ public sealed interface JSONCodec<T> extends TypeAwareCodec<T, Object, JsonWrite
      */
     @Override
     @Deprecated
-    default T parseValue(final Object ctx, final String str) {
+    default T parseValue(final Void ctx, final String str) {
         return parseValue(str);
     }