Skip to content

Commit c5062e0

Browse files
chore: create event interface
1 parent 247a3d6 commit c5062e0

File tree

1 file changed

+34
-0
lines changed
  • src/env/application/presenter/event/model

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package application.presenter.event.model;
10+
11+
/**
12+
* Interface that models a generic event with no additional fields but only with a key,
13+
* a payload data of type E and the dateTime of the event itself.
14+
* @param <E> the type of the payload data.
15+
*/
16+
public interface Event<E> {
17+
/**
18+
* Get the key of the event.
19+
* @return the key.
20+
*/
21+
String getKey();
22+
23+
/**
24+
* Get the data payload of the event.
25+
* @return the data payload.
26+
*/
27+
E getData();
28+
29+
/**
30+
* Get the date time in string format.
31+
* @return the string of date time.
32+
*/
33+
String getDateTime();
34+
}

0 commit comments

Comments
 (0)