Bump versions to 14.0.0-SNAPSHOT
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / ValueCodec.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.dom.codec.impl;
9
10 import org.eclipse.jdt.annotation.NonNull;
11
12 interface ValueCodec<S, D> {
13     /**
14      * Produce an internal object based on an external object.
15      *
16      * @param input Input object
17      * @return Product derived from input
18      * @throws NullPointerException if input is null
19      * @throws IllegalArgumentException when input is not valid
20      */
21     @NonNull D deserialize(@NonNull S input);
22
23     /**
24      * Produce an external object based on an internal object.
25      *
26      * @param input Input
27      * @return An external form object
28      * @throws NullPointerException if input is null
29      * @throws IllegalArgumentException when input is not valid
30      */
31     @NonNull S serialize(@NonNull D input);
32 }