Class ChangeQueryBuilder
java.lang.Object
com.google.gerrit.index.query.QueryBuilder<ChangeData,ChangeQueryBuilder>
com.google.gerrit.server.query.change.ChangeQueryBuilder
- Direct Known Subclasses:
ProjectWatch.WatcherChangeQueryBuilder,SubmitRequirementChangeQueryBuilder
Parses a query string meant to be applied to change objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic interfacestatic interfaceConverts a operand (operator value) passed to an operator into aPredicate.static interfaceNested classes/interfaces inherited from class com.google.gerrit.index.query.QueryBuilder
QueryBuilder.Definition<T,Q extends QueryBuilder<T, Q>>, QueryBuilder.Operator, QueryBuilder.OperatorFactory<T, Q extends QueryBuilder<T, Q>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final ChangeQueryBuilder.Argumentsstatic final Stringstatic final Stringstatic final StringDeprecated.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final com.google.common.base.Splitterstatic final Account.Idstatic final Account.Idstatic final Account.Idstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Account.IdFields inherited from class com.google.gerrit.index.query.QueryBuilder
builderDef, opAliases -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChangeQueryBuilder(QueryBuilder.Definition<ChangeData, ChangeQueryBuilder> def, ChangeQueryBuilder.Arguments args) protected -
Method Summary
Modifier and TypeMethodDescriptionasUser(CurrentUser user) protected voidcheckFieldAvailable(SchemaFieldDefs.SchemaField<ChangeData, ?> field, String errorMessage) cherryPickOf(String value) protected Predicate<ChangeData> defaultField(String query) Handle a value present outside of an operator.description(String text) destination(String value) Creates a predicate to match changes by file.getArgs()protected DestinationListgetDestinationList(BranchNameKey branch) protected QueryListgetQueryList(BranchNameKey branch) protected DestinationListloadDestinationList(BranchNameKey branch) protected QueryListloadQueryList(BranchNameKey branch) mergedAfter(String value) mergedBefore(String value) onlyextensions(String extList) parentproject(String name) parentrepo(String name) parentrepository(String name) prefixhashtag(String hashtag) prefixsubject(String value) prefixtopic(String name) repositories(String name) repository(String name) reviewedby(String who) reviewerByState(String who, ReviewerStateInternal state, boolean forDefaultField) reviewerin(String group) submissionId(String value) unresolved(String value) uploaderin(String group) protected voidvalidateLabelArgs(Set<Account.Id> accounts) visibleto(CurrentUser user) Methods inherited from class com.google.gerrit.index.query.QueryBuilder
error, error, find, find, parse, parse, setOperatorAliases
-
Field Details
-
FIELD_ADDED
- See Also:
-
FIELD_AGE
- See Also:
-
FIELD_ATTENTION_SET_USERS
- See Also:
-
FIELD_ATTENTION_SET_USERS_COUNT
- See Also:
-
FIELD_ATTENTION_SET_FULL
- See Also:
-
FIELD_ASSIGNEE
Deprecated.- See Also:
-
FIELD_AUTHOR
- See Also:
-
FIELD_EXACTAUTHOR
- See Also:
-
FIELD_CHANGE
- See Also:
-
FIELD_CHANGE_ID
- See Also:
-
FIELD_CHANGE_NUMBER
- See Also:
-
FIELD_COMMENT
- See Also:
-
FIELD_COMMENTBY
- See Also:
-
FIELD_COMMIT
- See Also:
-
FIELD_COMMITTER
- See Also:
-
FIELD_CUSTOM_KEYED_VALUES
- See Also:
-
FIELD_DIRECTORY
- See Also:
-
FIELD_EXACTCOMMITTER
- See Also:
-
FIELD_EXTENSION
- See Also:
-
FIELD_ONLY_EXTENSIONS
- See Also:
-
FIELD_FOOTER
- See Also:
-
FIELD_FOOTER_NAME
- See Also:
-
FIELD_CONFLICTS
- See Also:
-
FIELD_DELETED
- See Also:
-
FIELD_DELTA
- See Also:
-
FIELD_DESTINATION
- See Also:
-
FIELD_DRAFTBY
- See Also:
-
FIELD_EDITBY
- See Also:
-
FIELD_EXACTCOMMIT
- See Also:
-
FIELD_FILE
- See Also:
-
FIELD_FILEPART
- See Also:
-
FIELD_GROUP
- See Also:
-
FIELD_HASHTAG
- See Also:
-
FIELD_LABEL
- See Also:
-
FIELD_LIMIT
- See Also:
-
FIELD_MERGE
- See Also:
-
FIELD_MERGEABLE
- See Also:
-
FIELD_MERGED_ON
- See Also:
-
FIELD_MESSAGE
- See Also:
-
FIELD_SUBJECT
- See Also:
-
FIELD_PREFIX_SUBJECT
- See Also:
-
FIELD_MESSAGE_EXACT
- See Also:
-
FIELD_OWNER
- See Also:
-
FIELD_OWNERIN
- See Also:
-
FIELD_PARENTOF
- See Also:
-
FIELD_PARENTPROJECT
- See Also:
-
FIELD_PENDING_REVIEWER
- See Also:
-
FIELD_PENDING_REVIEWER_BY_EMAIL
- See Also:
-
FIELD_PRIVATE
- See Also:
-
FIELD_PROJECT
- See Also:
-
FIELD_PROJECTS
- See Also:
-
FIELD_REF
- See Also:
-
FIELD_REVIEWEDBY
- See Also:
-
FIELD_REVIEWERIN
- See Also:
-
FIELD_STAR
- See Also:
-
FIELD_STARBY
- See Also:
-
FIELD_STARTED
- See Also:
-
FIELD_STATUS
- See Also:
-
FIELD_SUBMISSIONID
- See Also:
-
FIELD_TR
- See Also:
-
FIELD_UNRESOLVED_COMMENT_COUNT
- See Also:
-
FIELD_UPLOADER
- See Also:
-
FIELD_UPLOADERIN
- See Also:
-
FIELD_VISIBLETO
- See Also:
-
FIELD_WATCHEDBY
- See Also:
-
FIELD_WIP
- See Also:
-
FIELD_REVERTOF
- See Also:
-
FIELD_PURE_REVERT
- See Also:
-
FIELD_CHERRYPICK
- See Also:
-
FIELD_CHERRY_PICK_OF_CHANGE
- See Also:
-
FIELD_CHERRY_PICK_OF_PATCHSET
- See Also:
-
FIELD_IS_SUBMITTABLE
- See Also:
-
ARG_ID_NAME
- See Also:
-
ARG_ID_USER
- See Also:
-
ARG_ID_GROUP
- See Also:
-
ARG_ID_OWNER
- See Also:
-
ARG_ID_NON_UPLOADER
- See Also:
-
ARG_ID_NON_CONTRIBUTOR
- See Also:
-
ARG_COUNT
- See Also:
-
ARG_USERS
- See Also:
-
OWNER_ACCOUNT_ID
-
NON_UPLOADER_ACCOUNT_ID
-
NON_CONTRIBUTOR_ACCOUNT_ID
-
NON_EXISTING_ACCOUNT_ID
-
OPERATOR_MERGED_BEFORE
- See Also:
-
OPERATOR_MERGED_AFTER
- See Also:
-
OPERATOR_BEFORE
- See Also:
-
OPERATOR_AFTER
- See Also:
-
args
-
hasOperandAliases
-
LABEL_SPLITTER
protected static final com.google.common.base.Splitter LABEL_SPLITTER
-
-
Constructor Details
-
ChangeQueryBuilder
-
ChangeQueryBuilder
protected ChangeQueryBuilder(QueryBuilder.Definition<ChangeData, ChangeQueryBuilder> def, ChangeQueryBuilder.Arguments args)
-
-
Method Details
-
asUser
-
getArgs
-
age
-
before
- Throws:
QueryParseException
-
until
- Throws:
QueryParseException
-
after
- Throws:
QueryParseException
-
since
- Throws:
QueryParseException
-
mergedBefore
- Throws:
QueryParseException
-
mergedAfter
- Throws:
QueryParseException
-
change
- Throws:
QueryParseException
-
comment
-
status
- Throws:
QueryParseException
-
statusOpen
-
rule
- Throws:
QueryParseException
-
has
- Throws:
QueryParseException
-
is
- Throws:
QueryParseException
-
commit
-
conflicts
- Throws:
QueryParseException
-
p
-
project
-
projects
-
parentof
- Throws:
QueryParseException
-
parentproject
-
repository
-
repositories
-
parentrepository
-
repo
-
repos
-
parentrepo
-
branch
- Throws:
QueryParseException
-
hashtag
-
inhashtag
- Throws:
QueryParseException
-
prefixhashtag
- Throws:
QueryParseException
-
topic
-
intopic
-
prefixtopic
- Throws:
QueryParseException
-
ref
- Throws:
QueryParseException
-
f
- Throws:
QueryParseException
-
file
Creates a predicate to match changes by file.- Parameters:
file- the value of thefilequery operator- Throws:
QueryParseException- thrown if parsing the value fails (may be thrown by subclasses)
-
path
-
ext
-
extension
-
onlyexts
-
onlyextensions
-
dir
-
directory
-
label
public Predicate<ChangeData> label(String name) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
validateLabelArgs
- Throws:
QueryParseException
-
d
- Throws:
QueryParseException
-
description
- Throws:
QueryParseException
-
m
- Throws:
QueryParseException
-
message
- Throws:
QueryParseException
-
subject
- Throws:
QueryParseException
-
prefixsubject
- Throws:
QueryParseException
-
visibleto
public Predicate<ChangeData> visibleto(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
visibleto
-
isVisible
- Throws:
QueryParseException
-
o
public Predicate<ChangeData> o(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
owner
public Predicate<ChangeData> owner(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
uploader
public Predicate<ChangeData> uploader(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
attention
public Predicate<ChangeData> attention(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
ownerin
- Throws:
QueryParseExceptionIOException
-
uploaderin
- Throws:
QueryParseExceptionIOException
-
r
public Predicate<ChangeData> r(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
reviewer
public Predicate<ChangeData> reviewer(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
cc
public Predicate<ChangeData> cc(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
reviewerin
- Throws:
QueryParseException
-
tr
-
bug
-
limit
- Throws:
QueryParseException
-
added
- Throws:
QueryParseException
-
deleted
- Throws:
QueryParseException
-
size
- Throws:
QueryParseException
-
delta
- Throws:
QueryParseException
-
commentby
public Predicate<ChangeData> commentby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
from
public Predicate<ChangeData> from(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
query
- Throws:
QueryParseException
-
getQueryList
protected QueryList getQueryList(BranchNameKey branch) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException - Throws:
org.eclipse.jgit.errors.ConfigInvalidExceptionIOException
-
loadQueryList
protected QueryList loadQueryList(BranchNameKey branch) throws org.eclipse.jgit.errors.ConfigInvalidException, IOException - Throws:
org.eclipse.jgit.errors.ConfigInvalidExceptionIOException
-
reviewedby
public Predicate<ChangeData> reviewedby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-
destination
- Throws:
QueryParseException
-
getDestinationList
protected DestinationList getDestinationList(BranchNameKey branch) throws org.eclipse.jgit.errors.ConfigInvalidException, org.eclipse.jgit.errors.RepositoryNotFoundException, IOException - Throws:
org.eclipse.jgit.errors.ConfigInvalidExceptionorg.eclipse.jgit.errors.RepositoryNotFoundExceptionIOException
-
loadDestinationList
protected DestinationList loadDestinationList(BranchNameKey branch) throws org.eclipse.jgit.errors.ConfigInvalidException, org.eclipse.jgit.errors.RepositoryNotFoundException, IOException - Throws:
org.eclipse.jgit.errors.ConfigInvalidExceptionorg.eclipse.jgit.errors.RepositoryNotFoundExceptionIOException
-
a
- Throws:
QueryParseException
-
author
- Throws:
QueryParseException
-
committer
- Throws:
QueryParseException
-
unresolved
- Throws:
QueryParseException
-
revertof
- Throws:
QueryParseException
-
submissionId
-
cherryPickOf
- Throws:
QueryParseException
-
defaultField
Description copied from class:QueryBuilderHandle a value present outside of an operator.This default implementation always throws an "Unsupported query: " message containing the input text. Subclasses may override this method to perform do-what-i-mean guesses based on the input string.
- Overrides:
defaultFieldin classQueryBuilder<ChangeData,ChangeQueryBuilder> - Parameters:
query- the value supplied by itself in the query.- Returns:
- predicate representing this value.
- Throws:
QueryParseException- the parser does not recognize this value.
-
checkFieldAvailable
protected void checkFieldAvailable(SchemaFieldDefs.SchemaField<ChangeData, ?> field, String errorMessage) throws QueryParseException- Throws:
QueryParseException
-
reviewerByState
public Predicate<ChangeData> reviewerByState(String who, ReviewerStateInternal state, boolean forDefaultField) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException - Throws:
QueryParseExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidException
-