All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.denimgroup.threadfix.data.enums.VulnerabilityDefectConsistencyState Maven / Gradle / Ivy

////////////////////////////////////////////////////////////////////////
//
//     Copyright (c) 2009-2016 Denim Group, Ltd.
//
//     The contents of this file are subject to the Mozilla Public License
//     Version 2.0 (the "License"); you may not use this file except in
//     compliance with the License. You may obtain a copy of the License at
//     http://www.mozilla.org/MPL/
//
//     Software distributed under the License is distributed on an "AS IS"
//     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
//     License for the specific language governing rights and limitations
//     under the License.
//
//     The Original Code is ThreadFix.
//
//     The Initial Developer of the Original Code is Denim Group, Ltd.
//     Portions created by Denim Group, Ltd. are Copyright (C)
//     Denim Group, Ltd. All Rights Reserved.
//
//     Contributor(s): Denim Group, Ltd.
//
////////////////////////////////////////////////////////////////////////
package com.denimgroup.threadfix.data.enums;

import com.fasterxml.jackson.annotation.JsonView;

public enum VulnerabilityDefectConsistencyState {
    CONSISTENT("The vulnerability is consistent with the defect"),
    VULN_OPEN_DEFECT_CLOSED_NEEDS_SCAN("The defect has been closed since the last scan"),
    VULN_OPEN_DEFECT_CLOSED_STILL_IN_SCAN("The defect has been closed but still showed up in a scan"),
    VULN_CLOSED_DEFECT_OPEN_NEEDS_SCAN("The defect has been opened since the last scan");

    VulnerabilityDefectConsistencyState(String displayName) {
        this.displayName = displayName;
    }

    private String displayName;

    @JsonView(Object.class)
    public String getDisplayName() { return displayName; }

    public static VulnerabilityDefectConsistencyState getVulnerabilityDefectConsistencyState(String input) {
        VulnerabilityDefectConsistencyState state = null; // no default state

        for (VulnerabilityDefectConsistencyState vulnerabilityDefectConsistencyState : values()) {
            if (vulnerabilityDefectConsistencyState.toString().equals(input) ||
                    vulnerabilityDefectConsistencyState.displayName.equals(input) ||
                    vulnerabilityDefectConsistencyState.displayName.replace(' ', '_').equals(input)) {
                state = vulnerabilityDefectConsistencyState;
                break;
            }
        }

        return state;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy