Refactor streamChild() methods
[mdsal.git] / binding / mdsal-binding-dom-codec-api / 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.BindingObject;
12
13 /**
14  * Caching variant of Binding to Normalized Node codec. Caching may introduce performance penalty to serialization and
15  * deserialization but may decrease use of heap for repetitive objects.
16  *
17  * @param <T> Binding representtion of data
18  */
19 @Beta
20 public interface BindingNormalizedNodeCachingCodec<T extends BindingObject> extends BindingNormalizedNodeCodec<T>,
21         AutoCloseable {
22     /**
23      * Invoking close will invalidate this codec and any of its child codecs and will invalidate cache. Any subsequent
24      * calls to this codec will fail with {@link IllegalStateException} thrown.
25      */
26     @Override
27     void close();
28 }