2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.access.concepts;
10 import static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.concepts.WritableIdentifier;
17 * Abstract Externalizable proxy for use with {@link Message} subclasses.
19 * @author Robert Varga
21 * @param <T> Target identifier type
22 * @param <C> Message class
24 abstract class AbstractMessageProxy<T extends WritableIdentifier, C extends Message<T, C>>
25 implements Message.SerialForm<T, C> {
27 private static final long serialVersionUID = 1L;
31 protected AbstractMessageProxy() {
35 AbstractMessageProxy(final @NonNull C message) {
36 this.message = requireNonNull(message);
40 public final C message() {
41 return verifyNotNull(message);
45 public final void setMessage(final C message) {
46 this.message = requireNonNull(message);
50 public final Object readResolve() {