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 / BindingNormalizedNodeCachingCodec.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 org.opendaylight.mdsal.binding.javav2.spec.base.TreeNode;
12
13 /**
14  * Caching variant of Binding to Normalized Node codec.
15  *
16  * Caching may introduce performance penalty to serialization / deserialization
17  * but may decrease use of heap for repetitive objects.
18  *
19  * @param <T>
20  *            - Binding representation of data
21  */
22 @Beta
23 public interface BindingNormalizedNodeCachingCodec<T extends TreeNode>
24         extends BindingNormalizedNodeCodec<T>, AutoCloseable {
25
26     /**
27      * Invoking close will invalidate this codec and any of its child codecs and
28      * will invalidate cache.
29      *
30      * Any subsequent calls to this codec will fail with
31      * {@link IllegalStateException} thrown.
32      */
33     @Override
34     void close();
35 }
36