class EdmxDetectorFactoryProvider implements DetectorFactoryProvider<EdmxDetector> {

    @Override
    public EdmxDetector buildDetector(DetectorDocument document) {
        notNull(document, "document can't be null");
        // The EDM-X detector fits a new model with each metric point.
        // That's why we're using hyperparameters instead of parameters here.
        val hyperparamsMap = document.getConfig().get("hyperparams");
        val hyperparams = objectMapper.convertValue(hyperparamsMap, EdmxHyperparams.class);
        val trusted = document.isTrusted();
        return new EdmxDetector(document.getUuid(), hyperparams, trusted);
    }

}