2 * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.dom.codec.impl;
10 import org.eclipse.jdt.annotation.NonNull;
12 interface ValueCodec<S, D> {
14 * Produce an internal object based on an external object.
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
21 @NonNull D deserialize(@NonNull S input);
24 * Produce an external object based on an internal object.
27 * @return An external form object
28 * @throws NullPointerException if input is null
29 * @throws IllegalArgumentException when input is not valid
31 @NonNull S serialize(@NonNull D input);