Skip to content

Commit e5816de

Browse files
chore: create event serializer interface
1 parent e93ac31 commit e5816de

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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.serialization;
10+
11+
import application.presenter.event.model.Event;
12+
13+
import java.util.Optional;
14+
15+
/**
16+
* Interface that models an event serializer.
17+
*/
18+
public interface EventSerializer {
19+
/**
20+
* Serialize an event to string.
21+
* @param eventToSerialize the event to serialize.
22+
* @return the string corresponding to the event.
23+
*/
24+
Optional<String> eventToString(Event<?> eventToSerialize);
25+
}

0 commit comments

Comments
 (0)