class ConfigurationChangedDTO implements EventDTO {

    static ConfigurationChangedDTO from(ConfigurationChanged configurationChanged, String type) {
        Preconditions.checkNotNull(configurationChanged);

        CassandraMailQueueViewConfiguration configuration = configurationChanged.getConfiguration();
        return new ConfigurationChangedDTO(
            configurationChanged.eventId().serialize(),
            configurationChanged.getAggregateId().asAggregateKey(),
            type,
            configuration.getBucketCount(),
            configuration.getUpdateBrowseStartPace(),
            configuration.getSliceWindow());
    }

    @JsonCreator  ConfigurationChangedDTO(
        @JsonProperty("eventId") int eventId,
        @JsonProperty("aggregateKey") String aggregateKey,
        @JsonProperty("type") String type,
        @JsonProperty("bucketCount") int bucketCount,
        @JsonProperty("updateBrowseStartPace") int updateBrowseStartPace,
        @JsonProperty("sliceWindow") Duration sliceWindow);

}