Deprecate concents.{Codec,Deserializer,Serializer} 56/97656/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Sep 2021 15:29:15 +0000 (17:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Sep 2021 15:29:49 +0000 (17:29 +0200)
These are not really useful, deprecate them for removal.

JIRA: YANGTOOLS-1335
Change-Id: Ie3fae2c7b82e5292f18dd43d2a3f04603b707d29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/AbstractCodec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/AbstractIllegalArgumentCodec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/AbstractUncheckedCodec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Codec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Deserializer.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/IllegalArgumentCodec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/Serializer.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/UncheckedCodec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/UncheckedDeserializer.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/UncheckedSerializer.java

index 47d4f3de7f0edf45ff12e8d86cea17887b8a909c..29758080f97fb9ccedcb00175bab06007aa9f6d2 100644 (file)
@@ -23,6 +23,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
  */
 @Beta
 @NonNullByDefault
+@Deprecated(since = "7.0.9", forRemoval = true)
 public abstract class AbstractCodec<P, I, X extends Exception> implements Codec<P, I, X> {
     @Override
     public final @NonNull I deserialize(@NonNull final P input) throws X {
index eed595ae5734046646707390f746f0c952d9fd96..c5e2784635b707a0c4166b5397431bbab8eef669 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.yangtools.concepts;
 
 import com.google.common.annotations.Beta;
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 
 /**
@@ -20,5 +21,10 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
 @NonNullByDefault
 public abstract class AbstractIllegalArgumentCodec<P, I> extends AbstractUncheckedCodec<P, I, IllegalArgumentException>
         implements IllegalArgumentCodec<P, I> {
+    @Override
+    protected abstract @NonNull I deserializeImpl(@NonNull P product);
 
+    // implementation is guarded from nulls and verified not to return null
+    @Override
+    protected abstract @NonNull P serializeImpl(@NonNull I input);
 }
index 0edb216da9f12bb42814461c507d6ed8491850f8..60095b6640f0a0d8f305334704668d8252ffc8fb 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
  */
 @Beta
 @NonNullByDefault
+@Deprecated(since = "7.0.9", forRemoval = true)
 public abstract class AbstractUncheckedCodec<P, I, X extends RuntimeException> extends AbstractCodec<P, I, X>
         implements UncheckedCodec<P, I, X> {
     @Override
index 91060a1b6663eeea1972a047fde24748333b5388..55514f1d556dee88bcfbd8594378a90005eea64d 100644 (file)
@@ -15,6 +15,7 @@ package org.opendaylight.yangtools.concepts;
  * @param <I> Input type
  * @param <X> Error exception type
  */
+@Deprecated(since = "7.0.9", forRemoval = true)
 public interface Codec<P, I, X extends Exception> extends Serializer<P, I, X>, Deserializer<I, P, X> {
     @Override
     I deserialize(P input) throws X;
index d327beafdd93b43cee1acedc2c0110b7360bd8a7..11e01626003f63db706f84b6901a95762cc5bd59 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.jdt.annotation.NonNull;
  * @param <I> Input type
  * @param <X> Error exception type
  */
+@Deprecated(since = "7.0.9", forRemoval = true)
 public interface Deserializer<P, I, X extends Exception> {
     /**
      * Produce an object base on input.
index e2b072ad8ea447d463acb70b6b97f35ef0a9cf57..b3ffc37debe89fe89566da8bceb87250205d7eb1 100644 (file)
@@ -18,5 +18,9 @@ import com.google.common.annotations.Beta;
  */
 @Beta
 public interface IllegalArgumentCodec<P, I> extends UncheckedCodec<P, I, IllegalArgumentException> {
+    @Override
+    P serialize(I input);
 
+    @Override
+    I deserialize(P input);
 }
index f7a85c00a9222e7d2d0422d93ea630ae94eea836..14288f27512da480239c077a3ff287ce6dca4dcf 100644 (file)
@@ -16,6 +16,7 @@ import org.eclipse.jdt.annotation.NonNull;
  * @param <I> Input type
  * @param <X> Error exception type
  */
+@Deprecated(since = "7.0.9", forRemoval = true)
 public interface Serializer<P, I, X extends Exception> {
     /**
      * Convert an input into a product.
index c1196a7d564854580e0c0a16171c4d756e9f61f5..2d741dbb46f7cc6139b0685877f2ef8bb71908d6 100644 (file)
@@ -18,6 +18,7 @@ import com.google.common.annotations.Beta;
  * @param <X> Error exception type
  */
 @Beta
+@Deprecated(since = "7.0.9", forRemoval = true)
 public interface UncheckedCodec<P, I, X extends RuntimeException>
     extends UncheckedSerializer<I, P, X>, UncheckedDeserializer<P, I, X>, Codec<P, I, X> {
 
index e6ffd6c9c62bc6495595a24b973c154ec1b344de..468fc09ff1b082a58aac7420859e9ef9d408bc8e 100644 (file)
@@ -17,6 +17,7 @@ import com.google.common.annotations.Beta;
  * @param <X> Error exception type
  */
 @Beta
+@Deprecated(since = "7.0.9", forRemoval = true)
 public interface UncheckedDeserializer<P, I, X extends RuntimeException> extends Serializer<P, I, X> {
     @Override
     P serialize(I input);
index a8683e5aac9b8af2eae4f35fcd3f818bd7020d10..36dfa5a8f380b03733b0251983f956a70040fadd 100644 (file)
@@ -17,6 +17,7 @@ import com.google.common.annotations.Beta;
  * @param <X> Error exception type
  */
 @Beta
+@Deprecated(since = "7.0.9", forRemoval = true)
 public interface UncheckedSerializer<P, I, X extends RuntimeException> extends Deserializer<P, I, X> {
     @Override
     P deserialize(I input);