Package org.revapi
Class FilterStartResult
- java.lang.Object
-
- org.revapi.FilterStartResult
-
public final class FilterStartResult extends Object
The result of the element filtering inTreeFilter
. The result tells the analysis whether to let the element pass or not to the next stage but also whether to descend to its children or not.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterStartResult
and(Iterable<FilterStartResult> others)
FilterStartResult
and(FilterStartResult other)
static FilterStartResult
defaultResult()
This result is undecided about its match and descend and is marked as inherited.static FilterStartResult
direct(Ternary match, Ternary descend)
static FilterStartResult
doesntMatch()
boolean
equals(Object o)
static FilterStartResult
from(FilterFinishResult result, Ternary descend)
static FilterStartResult
from(Ternary match, Ternary descend, boolean inherited)
Ternary
getDescend()
Ternary
getMatch()
The result of the testint
hashCode()
static FilterStartResult
inherit(FilterStartResult parent)
boolean
isInherited()
Tells whether the result is implicitly inherited from some parent element or if it was explicitly evaluated on some element.static FilterStartResult
matchAndDescend()
The result will match any element and will always descend to any element's children.FilterStartResult
negateMatch()
FilterStartResult
or(Iterable<FilterStartResult> others)
FilterStartResult
or(FilterStartResult other)
String
toString()
FilterStartResult
withDescend(Ternary descend)
FilterStartResult
withInherited(boolean inherited)
FilterStartResult
withMatch(Ternary match)
-
-
-
Method Detail
-
defaultResult
public static FilterStartResult defaultResult()
This result is undecided about its match and descend and is marked as inherited. This means that it doesn't influence the "decision" of other filters but if it is the only one present, it gives the consumers of the result the chance to make a decision whether to make the elements pass or not.This should be used by the tree filters in cases where they don't have anything to "say" about filtering (due to lack of configuration or something similar).
-
matchAndDescend
public static FilterStartResult matchAndDescend()
The result will match any element and will always descend to any element's children. This SHOULD NOT be used as a default value of the filter result. Instead, it is meant for situations where one wants to retrieve all elements in the tree usingElementForest.stream(Class, boolean, TreeFilter, Element)
or similar methods.
-
doesntMatch
public static FilterStartResult doesntMatch()
-
direct
public static FilterStartResult direct(Ternary match, Ternary descend)
-
inherit
public static FilterStartResult inherit(FilterStartResult parent)
-
from
public static FilterStartResult from(Ternary match, Ternary descend, boolean inherited)
-
from
public static FilterStartResult from(FilterFinishResult result, Ternary descend)
-
getMatch
public Ternary getMatch()
The result of the test
-
getDescend
public Ternary getDescend()
-
isInherited
public boolean isInherited()
Tells whether the result is implicitly inherited from some parent element or if it was explicitly evaluated on some element.
-
and
public FilterStartResult and(FilterStartResult other)
-
and
public FilterStartResult and(Iterable<FilterStartResult> others)
-
or
public FilterStartResult or(FilterStartResult other)
-
or
public FilterStartResult or(Iterable<FilterStartResult> others)
-
negateMatch
public FilterStartResult negateMatch()
-
withMatch
public FilterStartResult withMatch(Ternary match)
-
withDescend
public FilterStartResult withDescend(Ternary descend)
-
withInherited
public FilterStartResult withInherited(boolean inherited)
-
-