View Javadoc
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  import javax.annotation.concurrent.ThreadSafe;
21  
22  /**
23   * Used to duplicate vendor evidence within a collection. The intent is if any
24   * evidence is found in a collection that matches the value given the evidence
25   * will be duplicated and the value replaced with the value indicated.
26   *
27   * @author Jeremy Long
28   */
29  @ThreadSafe
30  public class VendorDuplicatingHintRule {
31  
32      /**
33       * The evidence value to duplicate if found.
34       */
35      private String value;
36  
37      /**
38       * The value to replace when duplicating the evidence.
39       */
40      private String duplicate;
41  
42      /**
43       * Constructs a new duplicating rule.
44       *
45       * @param value the value to duplicate the evidence if found
46       * @param duplicate the value to replace within the duplicated evidence
47       */
48      public VendorDuplicatingHintRule(String value, String duplicate) {
49          this.value = value;
50          this.duplicate = duplicate;
51      }
52  
53      /**
54       * Get the value of value.
55       *
56       * @return the value of value
57       */
58      public String getValue() {
59          return value;
60      }
61  
62      /**
63       * Set the value of value.
64       *
65       * @param value new value of value
66       */
67      public void setValue(String value) {
68          this.value = value;
69      }
70  
71      /**
72       * Get the value of duplicate.
73       *
74       * @return the value of duplicate
75       */
76      public String getDuplicate() {
77          return duplicate;
78      }
79  
80      /**
81       * Set the value of duplicate.
82       *
83       * @param duplicate new value of duplicate
84       */
85      public void setDuplicate(String duplicate) {
86          this.duplicate = duplicate;
87      }
88  }