| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| VendorDuplicatingHintRule |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * This file is part of dependency-check-core. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | * | |
| 16 | * Copyright (c) 2016 Jeremy Long. All Rights Reserved. | |
| 17 | */ | |
| 18 | package org.owasp.dependencycheck.xml.hints; | |
| 19 | ||
| 20 | /** | |
| 21 | * Used to duplicate vendor evidence within a collection. The intent is if any evidence | |
| 22 | * is found in a collection that matches the value given the evidence will be | |
| 23 | * duplicated and the value replaced with the value indicated. | |
| 24 | * | |
| 25 | * @author Jeremy Long | |
| 26 | */ | |
| 27 | public class VendorDuplicatingHintRule { | |
| 28 | ||
| 29 | /** | |
| 30 | * Constructs a new duplicating rule. | |
| 31 | * | |
| 32 | * @param value the value to duplicate the evidence if found | |
| 33 | * @param duplicate the value to replace within the duplicated evidence | |
| 34 | */ | |
| 35 | 10 | public VendorDuplicatingHintRule(String value, String duplicate) { |
| 36 | 10 | this.value = value; |
| 37 | 10 | this.duplicate = duplicate; |
| 38 | 10 | } |
| 39 | ||
| 40 | /** | |
| 41 | * The evidence value to duplicate if found. | |
| 42 | */ | |
| 43 | private String value; | |
| 44 | ||
| 45 | /** | |
| 46 | * Get the value of value. | |
| 47 | * | |
| 48 | * @return the value of value | |
| 49 | */ | |
| 50 | public String getValue() { | |
| 51 | 51 | return value; |
| 52 | } | |
| 53 | ||
| 54 | /** | |
| 55 | * Set the value of value. | |
| 56 | * | |
| 57 | * @param value new value of value | |
| 58 | */ | |
| 59 | public void setValue(String value) { | |
| 60 | 0 | this.value = value; |
| 61 | 0 | } |
| 62 | ||
| 63 | /** | |
| 64 | * The value to replace when duplicating the evidence. | |
| 65 | */ | |
| 66 | private String duplicate; | |
| 67 | ||
| 68 | /** | |
| 69 | * Get the value of duplicate. | |
| 70 | * | |
| 71 | * @return the value of duplicate | |
| 72 | */ | |
| 73 | public String getDuplicate() { | |
| 74 | 1 | return duplicate; |
| 75 | } | |
| 76 | ||
| 77 | /** | |
| 78 | * Set the value of duplicate. | |
| 79 | * | |
| 80 | * @param duplicate new value of duplicate | |
| 81 | */ | |
| 82 | public void setDuplicate(String duplicate) { | |
| 83 | 0 | this.duplicate = duplicate; |
| 84 | 0 | } |
| 85 | } |