class DetectorServiceImpl implements DetectorService {

    @Override
    public UUID createDetector(Detector detector) {
        notNull(detector, "detectorDto can't be null");
        isNull(detector.getUuid(), "Required: detectorDto.uuid == null");

        val uuid = UUID.randomUUID();
        detector.setId(uuid.toString());
        detector.setUuid(uuid);
        detector.setMeta(DetectorDataUtil.buildNewDetectorMeta(detector));
        RequestValidator.validateDetector(detector);
        repository.save(detector);
        return uuid;
    }

}