9998d0e9fe3bbddc8512a8eee80c835d9de10bd4
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / shard / DelegatingReadableCursorOperation.java
1 /*
2  * Copyright (c) 2016 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.dom.spi.shard;
9
10 import com.google.common.collect.ForwardingObject;
11 import java.util.Optional;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshotCursor;
15
16 /**
17  * Delegating implementation of a {@link ReadableCursorOperation}.
18  *
19  * @deprecated This interface is scheduled for removal in the next major release.
20  */
21 @Deprecated(forRemoval = true)
22 abstract class DelegatingReadableCursorOperation extends ForwardingObject implements ReadableCursorOperation {
23
24     @Override
25     protected abstract DataTreeSnapshotCursor delegate();
26
27     @Override
28     public Optional<NormalizedNode<?, ?>> readNode(final PathArgument arg) {
29         return delegate().readNode(arg);
30     }
31
32     @Override
33     public void exit() {
34         delegate().exit();
35     }
36
37     @Override
38     public DelegatingReadableCursorOperation enter(final PathArgument arg) {
39         delegate().enter(arg);
40         return this;
41     }
42 }