Class QueryMatch


  • public class QueryMatch
    extends Object
    A single query match.
    • Constructor Detail

      • QueryMatch

        public QueryMatch​(QueryTarget target,
                          Map<String,​Object> attributes,
                          List<QueryMatch> evidence)
        Creates a match, copying the attributes and evidence defensively.
        Parameters:
        target - the matched code location
        attributes - the computed attributes, may be null for none
        evidence - the nested evidence matches, may be null for none
    • Method Detail

      • getTarget

        public QueryTarget getTarget()
        Returns:
        the target
      • getEvidence

        public List<QueryMatch> getEvidence()
        Returns:
        the evidence
      • getAttributes

        public Map<String,​Object> getAttributes()
        Returns:
        an unmodifiable view of the computed attributes, in insertion order
      • getAttribute

        public Object getAttribute​(String name)
        Looks up one computed attribute.
        Parameters:
        name - the attribute name
        Returns:
        the value, or null if the attribute was not computed
      • hasEvidence

        public boolean hasEvidence()
        Returns:
        true if this match carries nested evidence matches
      • builder

        public static QueryMatch.Builder builder​(QueryTarget target)
        Starts a builder for a match at a code location.
        Parameters:
        target - the matched code location
        Returns:
        the new builder