Deprecate concents.{Codec,Deserializer,Serializer}
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / Serializer.java
index b00fbf04f294eb263c9a0b59f67990612876e0e0..14288f27512da480239c077a3ff287ce6dca4dcf 100644 (file)
@@ -7,9 +7,24 @@
  */
 package org.opendaylight.yangtools.concepts;
 
-// FIXME: 3.0.0: redesign/deprecate this class?
-//               - null should not be allowed as an input or return
-//               - we need error reporting
-public interface Serializer<P, I> {
-    P serialize(I input);
+import org.eclipse.jdt.annotation.NonNull;
+
+/**
+ * An entity which is able to convert some input into a product.
+ *
+ * @param <P> Product type
+ * @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.
+     *
+     * @param input Input
+     * @return A product
+     * @throws NullPointerException if input is null
+     * @throws X when input is not valid
+     */
+    @NonNull P serialize(@NonNull I input) throws X;
 }