*/
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;
}