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