08a52655adb63a36e81820b146d251ab84a74d4f
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / 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.mdsal.binding.dom.codec.api;
9
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.binding.DataObject;
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> Binding representtion of data
20  */
21 @Beta
22 public interface BindingNormalizedNodeCachingCodec<T extends DataObject> extends BindingNormalizedNodeCodec<T>,
23         AutoCloseable {
24     /**
25      * Invoking close will invalidate this codec and any of its child
26      * codecs and will invalidate cache.
27      *
28      * Any subsequent calls to this codec will fail with {@link IllegalStateException}
29      * thrown.
30      */
31     @Override
32     void close();
33 }