| 5 | import java.util.UUID; |
| 6 | |
| 7 | public abstract class Event<KEY, VALUE> { |
| 8 | private final String id; |
| 9 | private final Record<KEY, VALUE> element; |
| 10 | private final long timestamp; |
| 11 | |
| 12 | public Event(Record<KEY, VALUE> element, long timestamp) { |
| 13 | this.element = element; |
| 14 | this.timestamp = timestamp; |
| 15 | id = UUID.randomUUID().toString(); |
| 16 | } |
| 17 | |
| 18 | public String getId() { |
| 19 | return id; |
| 20 | } |
| 21 | |
| 22 | public Record<KEY, VALUE> getElement() { |
| 23 | return element; |
| 24 | } |
| 25 | |
| 26 | public long getTimestamp() { |
| 27 | return timestamp; |
| 28 | } |
| 29 | |
| 30 | @Override |
| 31 | public String toString() { |
| 32 | return this.getClass().getName() + "{" + |
| 33 | "element=" + element + |
| 34 | ", timestamp=" + timestamp + |
| 35 | "}\n"; |
| 36 | } |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected