f76dc28486f889a07ec9ebb5b2da9331b92e49fa
[controller.git] / opendaylight / md-sal / sal-akka-raft-example / src / main / java / org / opendaylight / controller / cluster / example / messages / KeyValue.java
1 /*
2  * Copyright (c) 2014 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.controller.cluster.example.messages;
9
10 import java.io.Serializable;
11 import org.opendaylight.controller.cluster.raft.messages.Payload;
12
13 public class KeyValue extends Payload implements Serializable {
14     private static final long serialVersionUID = 1L;
15     private String key;
16     private String value;
17
18     public KeyValue() {
19     }
20
21     public KeyValue(String key, String value) {
22         this.key = key;
23         this.value = value;
24     }
25
26     public String getKey() {
27         return key;
28     }
29
30     public String getValue() {
31         return value;
32     }
33
34     public void setKey(String key) {
35         this.key = key;
36     }
37
38     public void setValue(String value) {
39         this.value = value;
40     }
41
42     @Override
43     public String toString() {
44         return "KeyValue{" + "key='" + key + '\'' + ", value='" + value + '\'' + '}';
45     }
46
47     @Override
48     public int size() {
49         return value.length() + key.length();
50     }
51 }