Move {Identifiable,Persistent,}Payload
[controller.git] / opendaylight / md-sal / sal-akka-raft-example / src / main / java / org / opendaylight / controller / cluster / example / messages / KeyValue.java
index 87a77b271bb0a8780ba40fd9c903b6c627e35da7..f76dc28486f889a07ec9ebb5b2da9331b92e49fa 100644 (file)
@@ -5,14 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.cluster.example.messages;
 
-import com.google.protobuf.GeneratedMessage;
 import java.io.Serializable;
-import java.util.Map;
-import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;
-import org.opendaylight.controller.protobuff.messages.cluster.raft.AppendEntriesMessages;
+import org.opendaylight.controller.cluster.raft.messages.Payload;
 
 public class KeyValue extends Payload implements Serializable {
     private static final long serialVersionUID = 1L;
@@ -22,7 +18,7 @@ public class KeyValue extends Payload implements Serializable {
     public KeyValue() {
     }
 
-    public KeyValue(String key, String value){
+    public KeyValue(String key, String value) {
         this.key = key;
         this.value = value;
     }
@@ -43,26 +39,13 @@ public class KeyValue extends Payload implements Serializable {
         this.value = value;
     }
 
-    @Override public String toString() {
-        return "KeyValue{" +
-            "key='" + key + '\'' +
-            ", value='" + value + '\'' +
-            '}';
-    }
-
-    // override this method to return  the protobuff related extension fields and their values
-    @Override public Map<GeneratedMessage.GeneratedExtension<?, ?>, String> encode() {
-        return null;
-    }
-
-    // override this method to assign the values from protobuff
-    @Override public Payload decode(AppendEntriesMessages.AppendEntries.ReplicatedLogEntry.Payload payloadProtoBuff) {
-        return null;
+    @Override
+    public String toString() {
+        return "KeyValue{" + "key='" + key + '\'' + ", value='" + value + '\'' + '}';
     }
 
     @Override
     public int size() {
-        return this.value.length() + this.key.length();
+        return value.length() + key.length();
     }
-
 }