ROT: Rückbau auf automatische Commits - Testfälle laufen nicht mehr
[demos/kafka/training] / src / main / java / de / juplo / kafka / StateDocument.java
1 package de.juplo.kafka;
2
3 import lombok.ToString;
4 import org.springframework.data.annotation.Id;
5 import org.springframework.data.mongodb.core.mapping.Document;
6
7 import java.util.HashMap;
8 import java.util.Map;
9
10
11 @Document(collection = "state")
12 @ToString
13 public class StateDocument
14 {
15   @Id
16   public String id;
17   public Map<String, Long> state;
18
19   public StateDocument()
20   {
21   }
22
23   public StateDocument(Integer partition)
24   {
25     this.id = Integer.toString(partition);
26     this.state = new HashMap<>();
27   }
28
29   public StateDocument(
30       Integer partition,
31       Map<String, Long> state)
32   {
33     this.id = Integer.toString(partition);
34     this.state = state;
35   }
36 }