class CheckmarxProjectSupport {

    protected void updatePresetIdWhenSetInAdapterConfig(CheckmarxAdapterConfig config, CheckmarxSastScanSettings checkmarxScanSettings,
            InternalUpdateContext updateContext) {

        boolean updatePresetId = false;
        String projectId = config.getProjectId();

        /* check if the preset id needs to be updated */
        Long presetId = config.getPresetIdForNewProjectsOrNull();

        if (presetId == null) {
            LOG.debug("No presetId defined, so keep default preset.");
            presetId = checkmarxScanSettings.getPresetId();
        } else {
            LOG.debug("Wanted preset id {} for project {}", presetId, projectId);
            updatePresetId = true;
        }
        
        updateContext.setUpdatePresetId(updatePresetId);
        updateContext.setPresetId(presetId);
    }

}