--- /dev/null
+package de.juplo.kafka;
+
+import lombok.ToString;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+@Document(collection = "state")
+@ToString
+public class StateDocument
+{
+ @Id
+ public String id;
+ public long offset = -1l;
+ public Map<String, Long> state;
+
+ public StateDocument()
+ {
+ }
+
+ public StateDocument(Integer partition)
+ {
+ this.id = Integer.toString(partition);
+ this.state = new HashMap<>();
+ }
+
+ public StateDocument(Integer partition, Map<String, Long> state, long offset)
+ {
+ this.id = Integer.toString(partition);
+ this.state = state;
+ this.offset = offset;
+ }
+}