Binding v2 DOM Codec - codecs API - Part 1
[mdsal.git] / binding2 / mdsal-binding2-dom-codec / src / main / java / org / opendaylight / mdsal / binding / javav2 / dom / codec / api / codecs / BindingNormalizedNodeCodec.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies 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.javav2.dom.codec.api.codecs;
9
10 import com.google.common.annotations.Beta;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14
15 /**
16  * Codec providing serialization and deserializiation between Binding and
17  * NormalizedNode representation of data.
18  *
19  *
20  * @param <T>
21  *            - Binding representation of data
22  */
23 @Beta
24 public interface BindingNormalizedNodeCodec<T extends TreeNode> {
25
26     /**
27      * Converts from Normalized Node to Binding representation of data.
28      *
29      * @param data
30      *            - Normalized Node representation of data
31      * @return Binding representation of data
32      */
33     @Nonnull
34     T deserialize(@Nonnull NormalizedNode<?, ?> data);
35
36     /**
37      * Converts from Binding to Normalized Node representation of data.
38      *
39      * @param data
40      *            - Binding representation of data
41      * @return Normalized Node representation of data
42      */
43     @Nonnull
44     NormalizedNode<?, ?> serialize(@Nonnull T data);
45 }