Class EvidenceMatcher


  • public class EvidenceMatcher
    extends java.lang.Object
    EvidenceMatcher can match one or more Evidences. By using regular expressions for some fields and allowing omission of Evidence fields it can be used to match more than one occurrence of evidence to enable hints that work for a range of similar false positives/false negatives. The EvidenceMatcher is used for processing Evidences of a project's dependencies in conjunction with the <given> and <remove> clauses of the hints file.
    Author:
    Hans Aikema
    • Constructor Summary

      Constructors 
      Constructor Description
      EvidenceMatcher​(java.lang.String source, java.lang.String name, java.lang.String value, boolean regex, Confidence confidence)
      Creates a new EvidenceMatcher objects.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean matches​(Evidence evidence)
      Tests whether the given Evidence matches this EvidenceMatcher.
      java.lang.String toString()
      Standard toString() implementation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EvidenceMatcher

        public EvidenceMatcher​(java.lang.String source,
                               java.lang.String name,
                               java.lang.String value,
                               boolean regex,
                               Confidence confidence)
        Creates a new EvidenceMatcher objects.
        Parameters:
        source - the source of the evidence, a source that is null indicates any source should match.
        name - the non-null name of the evidence.
        value - the non-null value of the evidence.
        regex - whether value is a regex.
        confidence - the confidence of the evidence, a confidence that is null indicates any confidence should match.
    • Method Detail

      • matches

        public boolean matches​(Evidence evidence)
        Tests whether the given Evidence matches this EvidenceMatcher.
        Parameters:
        evidence - the evidence to match
        Returns:
        whether the evidence matches this matcher
      • toString

        public java.lang.String toString()
        Standard toString() implementation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of the object