2 * Copyright (c) 2014 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.example.messages;
10 import org.opendaylight.controller.cluster.raft.messages.Payload;
12 public final class KeyValue extends Payload {
13 private static final long serialVersionUID = 1L;
21 public KeyValue(String key, String value) {
26 public String getKey() {
30 public String getValue() {
35 public String toString() {
36 return "KeyValue{" + "key='" + key + '\'' + ", value='" + value + '\'' + '}';
41 return value.length() + key.length();
45 protected Object writeReplace() {
46 return new KVv1(value, key);