Remove unused protobuff messages
[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 com.google.protobuf.GeneratedMessage;
12 import java.io.Serializable;
13 import java.util.Map;
14 import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;
15 import org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages;
16
17 public class KeyValue extends Payload implements Serializable {
18     private static final long serialVersionUID = 1L;
19     private String key;
20     private String value;
21
22     public KeyValue() {
23     }
24
25     public KeyValue(String key, String value){
26         this.key = key;
27         this.value = value;
28     }
29
30     public String getKey() {
31         return key;
32     }
33
34     public String getValue() {
35         return value;
36     }
37
38     public void setKey(String key) {
39         this.key = key;
40     }
41
42     public void setValue(String value) {
43         this.value = value;
44     }
45
46     @Override public String toString() {
47         return "KeyValue{" +
48             "key='" + key + '\'' +
49             ", value='" + value + '\'' +
50             '}';
51     }
52
53     // override this method to return  the protobuff related extension fields and their values
54     @Override public Map<GeneratedMessage.GeneratedExtension<?, ?>, String> encode() {
55         return null;
56     }
57
58     // override this method to assign the values from protobuff
59     @Override public Payload decode(AppendEntriesMessages.AppendEntries.ReplicatedLogEntry.Payload payloadProtoBuff) {
60         return null;
61     }
62
63     @Override
64     public int size() {
65         return this.value.length() + this.key.length();
66     }
67
68 }