17897532ec852e5d5d019fd7168cf5bf96469250
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / remote / rpc / messages / AbstractResponse.java
1 /*
2  * Copyright (c) 2019 Nordix Foundation.  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.controller.remote.rpc.messages;
9
10 import java.io.Serializable;
11 import org.eclipse.jdt.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13
14 /**
15  * An abstract base class for invocation responses. Specialized via {@link ActionResponse} and {@link RpcResponse}.
16  */
17 public abstract class AbstractResponse<T extends NormalizedNode<?, ?>> implements Serializable {
18     private static final long serialVersionUID = 1L;
19
20     private final transient @Nullable T output;
21
22     public AbstractResponse(final @Nullable T output) {
23         this.output = output;
24     }
25
26     public final @Nullable T getOutput() {
27         return output;
28     }
29
30     abstract Object writeReplace();
31 }