Class EqualsLabelPredicate
- 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.ChangeIndexPostFilterPredicate
-
- com.google.gerrit.server.query.change.EqualsLabelPredicate
-
- All Implemented Interfaces:
Matchable<ChangeData>
public class EqualsLabelPredicate extends ChangeIndexPostFilterPredicate
-
-
Field Summary
Fields Modifier and Type Field Description protected Account.Id
account
Account ID that has voted on the label.protected Integer
count
protected int
expVal
Expected vote value for the label.protected AccountGroup.UUID
group
protected String
label
label name to be matched.protected PermissionBackend
permissionBackend
protected ProjectCache
projectCache
protected IdentifiedUser.GenericFactory
userFactory
-
Fields inherited from class com.google.gerrit.index.query.OperatorPredicate
name, value
-
-
Constructor Summary
Constructors Constructor Description EqualsLabelPredicate(LabelPredicate.Args args, String label, int expVal, Account.Id account, Integer count)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCost()
Returns a cost estimate to run this predicate, higher figures cost more.boolean
match(ChangeData object)
This method matches documents without calling an index subsystem.protected boolean
match(ChangeData cd, short value, Account.Id approver)
protected static LabelType
type(LabelTypes types, String toFind)
-
Methods inherited from class com.google.gerrit.server.query.change.ChangeIndexPredicate
none
-
Methods inherited from class com.google.gerrit.index.query.IndexPredicate
getField, getType
-
Methods inherited from class com.google.gerrit.index.query.OperatorPredicate
copy, equals, getOperator, getValue, hashCode, toString
-
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
-
-
-
-
Field Detail
-
projectCache
protected final ProjectCache projectCache
-
permissionBackend
protected final PermissionBackend permissionBackend
-
userFactory
protected final IdentifiedUser.GenericFactory userFactory
-
label
protected final String label
label name to be matched.
-
expVal
protected final int expVal
Expected vote value for the label.
-
count
protected final Integer count
-
account
protected final Account.Id account
Account ID that has voted on the label.
-
group
protected final AccountGroup.UUID group
-
-
Constructor Detail
-
EqualsLabelPredicate
public EqualsLabelPredicate(LabelPredicate.Args args, String label, int expVal, Account.Id account, Integer count)
-
-
Method Detail
-
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
-
type
protected static LabelType type(LabelTypes types, String toFind)
-
match
protected boolean match(ChangeData cd, short value, Account.Id approver)
-
getCost
public int getCost()
Description copied from interface:Matchable
Returns a cost estimate to run this predicate, higher figures cost more.- Specified by:
getCost
in interfaceMatchable<ChangeData>
- Overrides:
getCost
in classIndexPredicate<ChangeData>
-
-