private void updateInterruptCapability( InterruptCapability interruptCapability, InterruptCapabilityDto interruptCapabilityDto) { interruptCapability.setMaxDtus(interruptCapabilityDto.getMaxDtus()); interruptCapability.setType( UdiEventTransformer.transformToModel(interruptCapabilityDto.getType())); LOGGER.debug("Updated interrupt-capability with id [{}] ", interruptCapabilityDto.getId()); }
private InterruptCapability createInterruptCapability( InterruptCapabilityDto interruptCapabilityDto, UdiEvent udiEvent) { InterruptCapability interruptCapability = new InterruptCapability(); interruptCapability.setId(getDeviceCapabilityId(interruptCapabilityDto)); interruptCapability.setMaxDtus(interruptCapabilityDto.getMaxDtus()); interruptCapability.setType( UdiEventTransformer.transformToModel(interruptCapabilityDto.getType())); interruptCapability.setUdiEvent(udiEvent); interruptCapabilityRepository.persist(interruptCapability); LOGGER.debug( "Created new interrupt-capability with id [{}] for event with id [{}]", interruptCapabilityDto.getId(), udiEvent.getId()); return interruptCapability; }