Introduce UnresolvedQName
[yangtools.git] / common / concepts / src / main / java / org / opendaylight / yangtools / concepts / Deserializer.java
index 77034b8b2578eb437667c1a07d584be74f5e10d3..d327beafdd93b43cee1acedc2c0110b7360bd8a7 100644 (file)
@@ -7,7 +7,23 @@
  */
 package org.opendaylight.yangtools.concepts;
 
-public interface Deserializer<P,I> {
+import org.eclipse.jdt.annotation.NonNull;
 
-    P deserialize(I input);
+/**
+ * The concept of a deserializer, which produces an object from some input.
+ *
+ * @param <P> Product type
+ * @param <I> Input type
+ * @param <X> Error exception type
+ */
+public interface Deserializer<P, I, X extends Exception> {
+    /**
+     * Produce an object base on input.
+     *
+     * @param input Input object
+     * @return Product derived from input
+     * @throws NullPointerException if input is null
+     * @throws X when input is not valid
+     */
+    @NonNull P deserialize(@NonNull I input) throws X;
 }