class StorageStrategyChangedDTO implements EventDTO {

    static StorageStrategyChangedDTO from(StorageStrategyChanged storageStrategyChanged, String type) {
        Preconditions.checkNotNull(storageStrategyChanged);

        StorageStrategy storageStrategy = storageStrategyChanged.getStorageStrategy();
        return new StorageStrategyChangedDTO(
                storageStrategyChanged.eventId().serialize(),
                storageStrategyChanged.getAggregateId().asAggregateKey(),
                type,
                storageStrategy.name());
    }

    @JsonCreator  StorageStrategyChangedDTO(
            @JsonProperty("eventId") int eventId,
            @JsonProperty("aggregateKey") String aggregateKey,
            @JsonProperty("type") String type,
            @JsonProperty("storageStrategy") String storageStrategy);

}