Search in sources :

Example 1 with NoPropertyResolution

use of com.synopsys.integration.configuration.config.resolution.NoPropertyResolution in project synopsys-detect by blackducksoftware.

the class PropertyConfiguration method resolveFromPropertySources.

private PropertyResolution resolveFromPropertySources(@NotNull String key) {
    Assert.notNull(key, "Cannot resolve a null key.");
    for (PropertySource propertySource : orderedPropertySources) {
        if (propertySource.hasKey(key)) {
            String rawValue = propertySource.getValue(key);
            if (rawValue != null) {
                String name = propertySource.getName();
                String origin = propertySource.getOrigin(key);
                PropertyResolutionInfo propertyResolutionInfo = new PropertyResolutionInfo(name, origin, rawValue);
                return new SourcePropertyResolution(propertyResolutionInfo);
            }
        }
    }
    return new NoPropertyResolution();
}
Also used : SourcePropertyResolution(com.synopsys.integration.configuration.config.resolution.SourcePropertyResolution) PropertyResolutionInfo(com.synopsys.integration.configuration.config.resolution.PropertyResolutionInfo) PropertySource(com.synopsys.integration.configuration.source.PropertySource) NoPropertyResolution(com.synopsys.integration.configuration.config.resolution.NoPropertyResolution)

Aggregations

NoPropertyResolution (com.synopsys.integration.configuration.config.resolution.NoPropertyResolution)1 PropertyResolutionInfo (com.synopsys.integration.configuration.config.resolution.PropertyResolutionInfo)1 SourcePropertyResolution (com.synopsys.integration.configuration.config.resolution.SourcePropertyResolution)1 PropertySource (com.synopsys.integration.configuration.source.PropertySource)1