@Test public void testBuildDetector() { val factoryUnderTest = new IndividualsDetectorFactoryProvider(); val document = readDocument("individuals"); val detector = factoryUnderTest.buildDetector(document); val params = detector.getParams(); val trusted = detector.isTrusted(); assertNotNull(detector); assertEquals(true, trusted); assertEquals(IndividualsDetector.class, detector.getClass()); assertEquals("a6a4d8c4-4102-51fc-a1c7-38aa6f066cca", detector.getUuid().toString()); assertEquals(3.0, params.getStrongSigmas(), TOLERANCE); assertEquals(10.0, params.getInitValue(), TOLERANCE); assertEquals(30.0, params.getInitMeanEstimate(), TOLERANCE); assertEquals(30, params.getWarmUpPeriod()); }
@Override public IndividualsDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val paramsMap = document.getConfig().get("params"); val params = objectMapper.convertValue(paramsMap, IndividualsDetectorParams.class); val trusted = document.isTrusted(); return new IndividualsDetector(document.getUuid(), params, trusted, "individuals"); }
IndividualsDetectorFactoryProvider implements DetectorFactoryProvider<IndividualsDetector> { @Override public IndividualsDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val paramsMap = document.getConfig().get("params"); val params = objectMapper.convertValue(paramsMap, IndividualsDetectorParams.class); val trusted = document.isTrusted(); return new IndividualsDetector(document.getUuid(), params, trusted, "individuals"); } }
IndividualsDetectorFactoryProvider implements DetectorFactoryProvider<IndividualsDetector> { @Override public IndividualsDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val paramsMap = document.getConfig().get("params"); val params = objectMapper.convertValue(paramsMap, IndividualsDetectorParams.class); val trusted = document.isTrusted(); return new IndividualsDetector(document.getUuid(), params, trusted, "individuals"); }  }
IndividualsDetectorFactoryProvider implements DetectorFactoryProvider<IndividualsDetector> { @Override public IndividualsDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val paramsMap = document.getConfig().get("params"); val params = objectMapper.convertValue(paramsMap, IndividualsDetectorParams.class); val trusted = document.isTrusted(); return new IndividualsDetector(document.getUuid(), params, trusted, "individuals"); }  @Override IndividualsDetector buildDetector(DetectorDocument document); }
IndividualsDetectorFactoryProvider implements DetectorFactoryProvider<IndividualsDetector> { @Override public IndividualsDetector buildDetector(DetectorDocument document) { notNull(document, "document can't be null"); val paramsMap = document.getConfig().get("params"); val params = objectMapper.convertValue(paramsMap, IndividualsDetectorParams.class); val trusted = document.isTrusted(); return new IndividualsDetector(document.getUuid(), params, trusted, "individuals"); }  @Override IndividualsDetector buildDetector(DetectorDocument document);  }