class MysqlEventMapper {

    Event<Map<String, Object>> mapToGenericEvent(MysqlEvent mysqlEvent) {
        Map<String, Object> oldEntity = JsonParserUtils.jsonStringToMap(mysqlEvent.getOldEntity());
        Map<String, Object> newEntity = JsonParserUtils.jsonStringToMap(mysqlEvent.getNewEntity());
        return new Event<>(mysqlEvent.getEventType(), mysqlEvent.getEntityName(), newEntity, oldEntity);
    }

}