Turn DOMRpcResult's result back to NormalizedNode
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMRpcResult.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.dom.spi;
9
10 import com.google.common.collect.ForwardingObject;
11 import java.util.Collection;
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.eclipse.jdt.annotation.Nullable;
14 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
15 import org.opendaylight.yangtools.yang.common.RpcError;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17
18 /**
19  * Utility class which implements {@link DOMRpcResult} by forwarding all methods to a backing instance.
20  */
21 @NonNullByDefault
22 public abstract class ForwardingDOMRpcResult extends ForwardingObject implements DOMRpcResult {
23     @Override
24     protected abstract DOMRpcResult delegate();
25
26     @Override
27     public Collection<? extends RpcError> getErrors() {
28         return delegate().getErrors();
29     }
30
31     @Override
32     public @Nullable NormalizedNode<?, ?> getResult() {
33         return delegate().getResult();
34     }
35 }