Search in sources :

Example 1 with DetectOptionHelp

use of com.blackducksoftware.integration.hub.detect.help.DetectOptionHelp 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;
}
Also used : DetectOptionHelp(com.blackducksoftware.integration.hub.detect.help.DetectOptionHelp) DetectProperty(com.blackducksoftware.integration.hub.detect.configuration.DetectProperty)

Aggregations

DetectProperty (com.blackducksoftware.integration.hub.detect.configuration.DetectProperty)1 DetectOptionHelp (com.blackducksoftware.integration.hub.detect.help.DetectOptionHelp)1