class TechnologySettingService {

    @Transactional(readOnly = true)
    public Optional<String> getSettingValue(Long projectId, AvailableTechnologySettings availableTechnologySettings) {
        String code = availableTechnologySettings.getCode();
        Technology technology = availableTechnologySettings.getTechnology();
        Optional<TechnologySetting> savedSetting = technologySettingRepository.findByProjectIdAndCodeAndTechnology(projectId, code, technology);
        String value = null;
        if (savedSetting.isPresent()) {
            return Optional.of(savedSetting.get().getValue());
        }

        Optional<SettingDTO> setting = getSettingDefinitionFromTechnologyAndCode(technology, code);
        if (setting.isPresent()) {
            value = setting.get().getDefaultValue();
        }

        return Optional.ofNullable(value);
    }

}