Package com.tonic.analysis.query.planner
Class QueryMatch
- java.lang.Object
-
- com.tonic.analysis.query.planner.QueryMatch
-
public class QueryMatch extends Object
A single query match.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQueryMatch.BuilderFluent builder that accumulates attributes and evidence for one match.
-
Constructor Summary
Constructors Constructor Description QueryMatch(QueryTarget target, Map<String,Object> attributes, List<QueryMatch> evidence)Creates a match, copying the attributes and evidence defensively.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryMatch.Builderbuilder(QueryTarget target)Starts a builder for a match at a code location.ObjectgetAttribute(String name)Looks up one computed attribute.Map<String,Object>getAttributes()List<QueryMatch>getEvidence()QueryTargetgetTarget()booleanhasEvidence()
-
-
-
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 locationattributes- the computed attributes, may be null for noneevidence- 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
-
-