Make Payload Serializable
[controller.git] / opendaylight / md-sal / sal-akka-raft-example / src / main / java / org / opendaylight / controller / cluster / example / messages / KVv1.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, s.r.o. 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.controller.cluster.example.messages;
9
10 import java.io.Serializable;
11
12 final class KVv1 implements Serializable {
13     private static final long serialVersionUID = 1L;
14
15     private final String key;
16     private final String value;
17
18     KVv1(String key, String value) {
19         this.key = key;
20         this.value = value;
21     }
22
23     Object readResolve() {
24         return new KeyValue(key, value);
25     }
26 }