use of com.blackducksoftware.integration.hub.detect.configuration.DetectProperty in project hub-detect by blackducksoftware.
the class DetectOptionManager method init.
private void init() {
final Map<DetectProperty, DetectOption> detectOptionsMap = new HashMap<>();
final Map<DetectProperty, Object> propertyMap = detectConfiguration.getCurrentProperties();
if (null != propertyMap && !propertyMap.isEmpty()) {
for (final DetectProperty detectProperty : propertyMap.keySet()) {
final DetectOption option = processField(detectProperty, detectConfiguration.getPropertyValueAsString(detectProperty, PropertyAuthority.None));
if (option != null) {
if (!detectOptionsMap.containsKey(detectProperty)) {
detectOptionsMap.put(detectProperty, option);
}
}
}
}
detectOptions = detectOptionsMap.values().stream().sorted((o1, o2) -> o1.getDetectOptionHelp().primaryGroup.compareTo(o2.getDetectOptionHelp().primaryGroup)).collect(Collectors.toList());
detectGroups = detectOptions.stream().map(it -> it.getDetectOptionHelp().primaryGroup).distinct().sorted().collect(Collectors.toList());
checkForRemovedProperties();
}
use of com.blackducksoftware.integration.hub.detect.configuration.DetectProperty in project hub-detect by blackducksoftware.
the class HelpJsonWriter method convertOption.
public HelpJsonOption convertOption(DetectOption detectOption) {
HelpJsonOption helpJsonOption = new HelpJsonOption();
DetectProperty property = detectOption.getDetectProperty();
helpJsonOption.propertyName = property.getPropertyName();
helpJsonOption.propertyKey = property.getPropertyKey();
helpJsonOption.propertyType = property.getPropertyType().getDisplayName();
helpJsonOption.addedInVersion = property.getAddedInVersion();
helpJsonOption.defaultValue = property.getDefaultValue();
DetectOptionHelp optionHelp = detectOption.getDetectOptionHelp();
helpJsonOption.group = optionHelp.primaryGroup;
helpJsonOption.additionalGroups = optionHelp.groups;
helpJsonOption.description = optionHelp.description;
helpJsonOption.detailedDescription = optionHelp.detailedHelp;
helpJsonOption.deprecated = optionHelp.isDeprecated;
if (optionHelp.isDeprecated) {
helpJsonOption.deprecatedDescription = optionHelp.deprecation;
helpJsonOption.deprecatedFailInVersion = optionHelp.deprecationFailInVersion.getDisplayValue();
helpJsonOption.deprecatedRemoveInVersion = optionHelp.deprecationRemoveInVersion.getDisplayValue();
}
helpJsonOption.strictValues = detectOption.hasStrictValidation();
helpJsonOption.caseSensitiveValues = detectOption.hasCaseSensitiveValidation();
helpJsonOption.acceptableValues = detectOption.getValidValues();
helpJsonOption.hasAcceptableValues = detectOption.getValidValues().size() > 0;
helpJsonOption.isCommaSeparatedList = detectOption.isCommaSeperatedList();
return helpJsonOption;
}
Aggregations