package gobblin.source.extractor.extract.kafka;

import lombok.Getter;

@Getter
public class KafkaRecord {

    private final long offset;
    private final String key;
    private final String payload;

    public KafkaRecord(long offset, String key, String payload) {
        this.offset = offset;
        this.key = key;
        this.payload = payload;
    }

    @Override
    public String toString() {
        return "KafkaRecord [offset=" + offset + ", key=" + key + ", payload=" + payload + "]";
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        result = prime * result + (int) (offset ^ (offset >>> 32));
        result = prime * result + ((payload == null) ? 0 : payload.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        KafkaRecord other = (KafkaRecord) obj;
        if (key == null) {
            if (other.key != null) {
                return false;
            }
        } else if (!key.equals(other.key)) {
            return false;
        }
        if (offset != other.offset) {
            return false;
        }
        if (payload == null) {
            if (other.payload != null) {
                return false;
            }
        } else if (!payload.equals(other.payload)) {
            return false;
        }
        return true;
    }

}

@@ -5,40 +5,26 @@
 age 
-gobblin.source.extractor.extract
+uk.gov.ipt.gobblin
 .kaf
@@ -83,16 +83,51 @@
 kaRecord
+ implements Comparable%3CKafkaRecord%3E
  %7B%0A%0A    
@@ -140,17 +140,17 @@
 e final 
-l
+L
 ong offs
@@ -280,24 +280,41 @@
  payload) %7B%0A
+        super();%0A
         this
@@ -1690,10 +1690,107 @@
 %0A    %7D%0A%0A
+    public int compareTo(KafkaRecord o) %7B%0A        return this.offset.compareTo(o.offset);%0A    %7D%0A%0A
 %7D%0A

Enhance KafkaRecord