From a83ea9a2dda390ac804bc41144b049ad99f36fcf Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 2 Apr 2024 10:56:42 +0200 Subject: [PATCH] Specialize JSONCodec to JSONValueWriter Completely disconnect JSONCodec from JsonWriter, eliminating the deprecated method. JIRA: YANGTOOLS-1568 Change-Id: I41f7426a11e76e90d717a898dfc916141e05ebf4 Signed-off-by: Robert Varga --- .../yangtools/yang/data/codec/gson/JSONCodec.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONCodec.java b/codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONCodec.java index b4dd7336b9..577f2c24ad 100644 --- a/codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONCodec.java +++ b/codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JSONCodec.java @@ -17,27 +17,14 @@ import org.opendaylight.yangtools.yang.data.util.codec.TypeAwareCodec; * * @param Normalized value type */ -public sealed interface JSONCodec extends TypeAwareCodec +public sealed interface JSONCodec extends TypeAwareCodec permits AbstractJSONCodec, EmptyJSONCodec, IdentityrefJSONCodec, InstanceIdentifierJSONCodec, UnionJSONCodec { /** * {@inheritDoc}. * * @throws IOException if the write fails - * @deprecated Use {@link #writeValue(JSONValueWriter, Object)} instead. */ @Override - @Deprecated(since = "13.0.3", forRemoval = true) - default void writeValue(final JsonWriter writer, final T value) throws IOException { - writeValue(new DefaultJSONValueWriter(writer), value); - } - - /** - * Serialize specified value with specified {@link JSONValueWriter}. - * - * @param ctx Write context - * @param value Value in native format - * @throws IOException if the write fails - */ void writeValue(JSONValueWriter ctx, T value) throws IOException; /** -- 2.36.6