Add JavaDoc comments to SerializationService
This commit is contained in:
@ -22,11 +22,25 @@ public class SerializationService {
|
||||
this.eventStore = eventStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* Übersetzt mithilfe der Jackson-Library eine Java-Event-Repräsentation zu einem JSON-Event-Payload.
|
||||
*
|
||||
* @param event Java-Event-Repräsentation
|
||||
* @return JSON-Event-Payload als String
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
public String serializeEvent(Event event) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
return mapper.writeValueAsString(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Übersetzt mithilfe der Jackson-Library einen JSON-Event-Payload zu einer Java-Event-Repräsentation.
|
||||
*
|
||||
* @param json JSON-Event-Payload als String
|
||||
* @return Java-Event-Repräsentation
|
||||
* @throws JsonProcessingException
|
||||
*/
|
||||
public Event deserializeEvent(String json) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
return mapper.readValue(json, Event.class);
|
||||
|
||||
Reference in New Issue
Block a user