MCPcopy Create free account
hub / github.com/InterviewReady/Low-Level-Design / Event

Class Event

distributed-event-bus/src/main/java/models/Event.java:5–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import java.util.UUID;
4
5public class Event {
6 private final String id;
7 private final String publisher;
8 private final EventType eventType;
9 private final String description;
10 private final long creationTime;
11
12 public Event(final String publisher,
13 final EventType eventType,
14 final String description,
15 final long creationTime) {
16 this.description = description;
17 this.id = UUID.randomUUID().toString();
18 this.publisher = publisher;
19 this.eventType = eventType;
20 this.creationTime = creationTime;
21 }
22
23 public String getId() {
24 return id;
25 }
26
27 public String getPublisher() {
28 return publisher;
29 }
30
31 public EventType getEventType() {
32 return eventType;
33 }
34
35 public long getCreationTime() {
36 return creationTime;
37 }
38
39 public String getDescription() {
40 return description;
41 }
42}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected