public final class Explanation
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
description |
private java.util.List<Explanation> |
details |
private boolean |
match |
private java.lang.Number |
value |
Modifier | Constructor and Description |
---|---|
private |
Explanation(boolean match,
java.lang.Number value,
java.lang.String description,
java.util.Collection<Explanation> details)
Create a new explanation
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getDescription()
A description of this explanation node.
|
Explanation[] |
getDetails()
The sub-nodes of this explanation node.
|
private java.lang.String |
getSummary() |
java.lang.Number |
getValue()
The value assigned to this explanation node.
|
int |
hashCode() |
boolean |
isMatch()
Indicates whether or not this Explanation models a match.
|
static Explanation |
match(java.lang.Number value,
java.lang.String description,
java.util.Collection<Explanation> details)
Create a new explanation for a match.
|
static Explanation |
match(java.lang.Number value,
java.lang.String description,
Explanation... details)
Create a new explanation for a match.
|
static Explanation |
noMatch(java.lang.String description,
java.util.Collection<Explanation> details)
Create a new explanation for a document which does not match.
|
static Explanation |
noMatch(java.lang.String description,
Explanation... details)
Create a new explanation for a document which does not match.
|
java.lang.String |
toString()
Render an explanation as text.
|
private java.lang.String |
toString(int depth) |
private final boolean match
private final java.lang.Number value
private final java.lang.String description
private final java.util.List<Explanation> details
private Explanation(boolean match, java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)
public static Explanation match(java.lang.Number value, java.lang.String description, java.util.Collection<Explanation> details)
value
- the contribution to the score of the documentdescription
- how value
was computeddetails
- sub explanations that contributed to this explanationpublic static Explanation match(java.lang.Number value, java.lang.String description, Explanation... details)
value
- the contribution to the score of the documentdescription
- how value
was computeddetails
- sub explanations that contributed to this explanationpublic static Explanation noMatch(java.lang.String description, java.util.Collection<Explanation> details)
public static Explanation noMatch(java.lang.String description, Explanation... details)
public boolean isMatch()
public java.lang.Number getValue()
public java.lang.String getDescription()
private java.lang.String getSummary()
public Explanation[] getDetails()
public java.lang.String toString()
toString
in class java.lang.Object
private java.lang.String toString(int depth)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object