2e990d9d540b8031979514cbf787b8ee8a5ad440
[mdsal.git] / code-generator / binding-data-codec / src / main / java / org / opendaylight / yangtools / binding / data / codec / api / BindingNormalizedNodeCachingCodec.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. 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.yangtools.binding.data.codec.api;
9
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.binding.DataObject;
12
13 /**
14  *
15  * Caching variant of Binding to Normalized Node codec.
16  *
17  * Caching may introduce performance penalty to serialization / deserialization
18  * but may decrease use of heap for repetitive objects.
19  *
20  * @param <T> Binding representtion of data
21  *
22  */
23 @Beta
24 public interface BindingNormalizedNodeCachingCodec<T extends DataObject> extends BindingNormalizedNodeCodec<T>, AutoCloseable {
25
26     /**
27      *
28      * Invoking close will invalidate this codec and any of its child
29      * codecs and will invalidate cache.
30      *
31      * Any subsequent calls to this codec will fail with {@link IllegalStateException}
32      * thrown.
33      *
34      */
35     @Override
36     public void close();
37 }