Class ChangeStatusPredicate
- java.lang.Object
-
- com.google.gerrit.index.query.Predicate<T>
-
- com.google.gerrit.index.query.OperatorPredicate<I>
-
- com.google.gerrit.index.query.IndexPredicate<ChangeData>
-
- com.google.gerrit.server.query.change.ChangeIndexPredicate
-
- com.google.gerrit.server.query.change.ChangeStatusPredicate
-
- All Implemented Interfaces:
HasCardinality
,Matchable<ChangeData>
public final class ChangeStatusPredicate extends ChangeIndexPredicate implements HasCardinality
Predicate for aChange.Status
.The actual name of this operator can differ, it usually comes as
status:
but may also beis:
to help do-what-i-meanery for end-users searching for changes. Either operator name has the same meaning.Status names are looked up by prefix case-insensitively.
-
-
Field Summary
-
Fields inherited from class com.google.gerrit.index.query.OperatorPredicate
name, value
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
canonicalize(Change.Status status)
static Predicate<ChangeData>
closed()
boolean
equals(Object other)
static ChangeStatusPredicate
forStatus(Change.Status status)
int
getCardinality()
Returns an estimate of the number of results a source can return.Change.Status
getStatus()
Get the status for this predicate.int
hashCode()
boolean
match(ChangeData object)
This method matches documents without calling an index subsystem.static Predicate<ChangeData>
open()
static Predicate<ChangeData>
parse(String value)
String
toString()
-
Methods inherited from class com.google.gerrit.server.query.change.ChangeIndexPredicate
none
-
Methods inherited from class com.google.gerrit.index.query.IndexPredicate
getCost, getField, getType
-
Methods inherited from class com.google.gerrit.index.query.OperatorPredicate
copy, getOperator, getValue
-
Methods inherited from class com.google.gerrit.index.query.Predicate
and, and, any, asMatchable, estimateCost, getChild, getChildCount, getChildren, getFlattenedPredicateList, getLeafCount, getPredicateString, isLeaf, isMatchable, not, or, or, supportedForQueries
-
-
-
-
Method Detail
-
canonicalize
public static String canonicalize(Change.Status status)
-
parse
public static Predicate<ChangeData> parse(String value) throws QueryParseException
- Throws:
QueryParseException
-
open
public static Predicate<ChangeData> open()
-
closed
public static Predicate<ChangeData> closed()
-
forStatus
public static ChangeStatusPredicate forStatus(Change.Status status)
-
getStatus
public Change.Status getStatus()
Get the status for this predicate.- Returns:
- the status, or null if this predicate is intended to never match any changes.
-
match
public boolean match(ChangeData object)
Description copied from class:IndexPredicate
This method matches documents without calling an index subsystem. For primitive fields (e.g. integer, long) , the matching logic is consistent across this method and all known index implementations. For text fields (i.e. prefix and full-text) the semantics vary between this implementation and known index implementations:- Prefix: Lucene as well as
IndexPredicate.match(Object)
matches terms as true prefixes (prefix:foo -> `foo bar` matches, but `baz foo bar` does not match). The index implementation at Google tokenizes both the query and the indexed text and matches tokens individually (prefix:fo ba -> `baz foo bar` matches).- Full text: Lucene uses a
PhraseQuery
to search for terms in full text fields in-order. The index implementation at Google as well asIndexPredicate.match(Object)
tokenizes both the query and the indexed text and matches tokens individually.- Specified by:
match
in interfaceMatchable<ChangeData>
- Overrides:
match
in classIndexPredicate<ChangeData>
- Returns:
- true if the predicate matches the provided
I
.
- Prefix: Lucene as well as
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classOperatorPredicate<ChangeData>
-
equals
public boolean equals(Object other)
- Overrides:
equals
in classOperatorPredicate<ChangeData>
-
toString
public String toString()
- Overrides:
toString
in classOperatorPredicate<ChangeData>
-
getCardinality
public int getCardinality()
Description copied from interface:HasCardinality
Returns an estimate of the number of results a source can return.- Specified by:
getCardinality
in interfaceHasCardinality
-
-