Class ChangeQueryBuilder
- java.lang.Object
-
- com.google.gerrit.index.query.QueryBuilder<ChangeData,ChangeQueryBuilder>
-
- com.google.gerrit.server.query.change.ChangeQueryBuilder
-
public class ChangeQueryBuilder extends QueryBuilder<ChangeData,ChangeQueryBuilder>
Parses a query string meant to be applied to change objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChangeQueryBuilder.Arguments
static interface
ChangeQueryBuilder.ChangeHasOperandFactory
static interface
ChangeQueryBuilder.ChangeIsOperandFactory
static interface
ChangeQueryBuilder.ChangeOperandFactory
Converts a operand (operator value) passed to an operator into aPredicate
.static interface
ChangeQueryBuilder.ChangeOperatorFactory
-
Nested 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
-
Fields inherited from class com.google.gerrit.index.query.QueryBuilder
builderDef, opAliases
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ChangeQueryBuilder(QueryBuilder.Definition<ChangeData,ChangeQueryBuilder> def, ChangeQueryBuilder.Arguments args)
-
Method Summary
-
Methods inherited from class com.google.gerrit.index.query.QueryBuilder
error, error, find, find, parse, parse, setOperatorAliases
-
-
-
-
Field Detail
-
FIELD_ADDED
public static final String FIELD_ADDED
- See Also:
- Constant Field Values
-
FIELD_AGE
public static final String FIELD_AGE
- See Also:
- Constant Field Values
-
FIELD_ATTENTION_SET_USERS
public static final String FIELD_ATTENTION_SET_USERS
- See Also:
- Constant Field Values
-
FIELD_ATTENTION_SET_FULL
public static final String FIELD_ATTENTION_SET_FULL
- See Also:
- Constant Field Values
-
FIELD_ASSIGNEE
public static final String FIELD_ASSIGNEE
- See Also:
- Constant Field Values
-
FIELD_AUTHOR
public static final String FIELD_AUTHOR
- See Also:
- Constant Field Values
-
FIELD_EXACTAUTHOR
public static final String FIELD_EXACTAUTHOR
- See Also:
- Constant Field Values
-
FIELD_BEFORE
public static final String FIELD_BEFORE
- See Also:
- Constant Field Values
-
FIELD_CHANGE
public static final String FIELD_CHANGE
- See Also:
- Constant Field Values
-
FIELD_CHANGE_ID
public static final String FIELD_CHANGE_ID
- See Also:
- Constant Field Values
-
FIELD_COMMENT
public static final String FIELD_COMMENT
- See Also:
- Constant Field Values
-
FIELD_COMMENTBY
public static final String FIELD_COMMENTBY
- See Also:
- Constant Field Values
-
FIELD_COMMIT
public static final String FIELD_COMMIT
- See Also:
- Constant Field Values
-
FIELD_COMMITTER
public static final String FIELD_COMMITTER
- See Also:
- Constant Field Values
-
FIELD_DIRECTORY
public static final String FIELD_DIRECTORY
- See Also:
- Constant Field Values
-
FIELD_EXACTCOMMITTER
public static final String FIELD_EXACTCOMMITTER
- See Also:
- Constant Field Values
-
FIELD_EXTENSION
public static final String FIELD_EXTENSION
- See Also:
- Constant Field Values
-
FIELD_ONLY_EXTENSIONS
public static final String FIELD_ONLY_EXTENSIONS
- See Also:
- Constant Field Values
-
FIELD_FOOTER
public static final String FIELD_FOOTER
- See Also:
- Constant Field Values
-
FIELD_CONFLICTS
public static final String FIELD_CONFLICTS
- See Also:
- Constant Field Values
-
FIELD_DELETED
public static final String FIELD_DELETED
- See Also:
- Constant Field Values
-
FIELD_DELTA
public static final String FIELD_DELTA
- See Also:
- Constant Field Values
-
FIELD_DESTINATION
public static final String FIELD_DESTINATION
- See Also:
- Constant Field Values
-
FIELD_DRAFTBY
public static final String FIELD_DRAFTBY
- See Also:
- Constant Field Values
-
FIELD_EDITBY
public static final String FIELD_EDITBY
- See Also:
- Constant Field Values
-
FIELD_EXACTCOMMIT
public static final String FIELD_EXACTCOMMIT
- See Also:
- Constant Field Values
-
FIELD_FILE
public static final String FIELD_FILE
- See Also:
- Constant Field Values
-
FIELD_FILEPART
public static final String FIELD_FILEPART
- See Also:
- Constant Field Values
-
FIELD_GROUP
public static final String FIELD_GROUP
- See Also:
- Constant Field Values
-
FIELD_HASHTAG
public static final String FIELD_HASHTAG
- See Also:
- Constant Field Values
-
FIELD_LABEL
public static final String FIELD_LABEL
- See Also:
- Constant Field Values
-
FIELD_LIMIT
public static final String FIELD_LIMIT
- See Also:
- Constant Field Values
-
FIELD_MERGE
public static final String FIELD_MERGE
- See Also:
- Constant Field Values
-
FIELD_MERGEABLE
public static final String FIELD_MERGEABLE
- See Also:
- Constant Field Values
-
FIELD_MESSAGE
public static final String FIELD_MESSAGE
- See Also:
- Constant Field Values
-
FIELD_OWNER
public static final String FIELD_OWNER
- See Also:
- Constant Field Values
-
FIELD_OWNERIN
public static final String FIELD_OWNERIN
- See Also:
- Constant Field Values
-
FIELD_PARENTPROJECT
public static final String FIELD_PARENTPROJECT
- See Also:
- Constant Field Values
-
FIELD_PATH
public static final String FIELD_PATH
- See Also:
- Constant Field Values
-
FIELD_PENDING_REVIEWER
public static final String FIELD_PENDING_REVIEWER
- See Also:
- Constant Field Values
-
FIELD_PENDING_REVIEWER_BY_EMAIL
public static final String FIELD_PENDING_REVIEWER_BY_EMAIL
- See Also:
- Constant Field Values
-
FIELD_PRIVATE
public static final String FIELD_PRIVATE
- See Also:
- Constant Field Values
-
FIELD_PROJECT
public static final String FIELD_PROJECT
- See Also:
- Constant Field Values
-
FIELD_PROJECTS
public static final String FIELD_PROJECTS
- See Also:
- Constant Field Values
-
FIELD_REF
public static final String FIELD_REF
- See Also:
- Constant Field Values
-
FIELD_REVIEWEDBY
public static final String FIELD_REVIEWEDBY
- See Also:
- Constant Field Values
-
FIELD_REVIEWER
public static final String FIELD_REVIEWER
- See Also:
- Constant Field Values
-
FIELD_REVIEWERIN
public static final String FIELD_REVIEWERIN
- See Also:
- Constant Field Values
-
FIELD_STAR
public static final String FIELD_STAR
- See Also:
- Constant Field Values
-
FIELD_STARBY
public static final String FIELD_STARBY
- See Also:
- Constant Field Values
-
FIELD_STARREDBY
public static final String FIELD_STARREDBY
- See Also:
- Constant Field Values
-
FIELD_STARTED
public static final String FIELD_STARTED
- See Also:
- Constant Field Values
-
FIELD_STATUS
public static final String FIELD_STATUS
- See Also:
- Constant Field Values
-
FIELD_SUBMISSIONID
public static final String FIELD_SUBMISSIONID
- See Also:
- Constant Field Values
-
FIELD_TR
public static final String FIELD_TR
- See Also:
- Constant Field Values
-
FIELD_UNRESOLVED_COMMENT_COUNT
public static final String FIELD_UNRESOLVED_COMMENT_COUNT
- See Also:
- Constant Field Values
-
FIELD_VISIBLETO
public static final String FIELD_VISIBLETO
- See Also:
- Constant Field Values
-
FIELD_WATCHEDBY
public static final String FIELD_WATCHEDBY
- See Also:
- Constant Field Values
-
FIELD_WIP
public static final String FIELD_WIP
- See Also:
- Constant Field Values
-
FIELD_REVERTOF
public static final String FIELD_REVERTOF
- See Also:
- Constant Field Values
-
FIELD_CHERRY_PICK_OF
public static final String FIELD_CHERRY_PICK_OF
- See Also:
- Constant Field Values
-
FIELD_CHERRY_PICK_OF_CHANGE
public static final String FIELD_CHERRY_PICK_OF_CHANGE
- See Also:
- Constant Field Values
-
FIELD_CHERRY_PICK_OF_PATCHSET
public static final String FIELD_CHERRY_PICK_OF_PATCHSET
- See Also:
- Constant Field Values
-
ARG_ID_USER
public static final String ARG_ID_USER
- See Also:
- Constant Field Values
-
ARG_ID_GROUP
public static final String ARG_ID_GROUP
- See Also:
- Constant Field Values
-
ARG_ID_OWNER
public static final String ARG_ID_OWNER
- See Also:
- Constant Field Values
-
OWNER_ACCOUNT_ID
public static final Account.Id OWNER_ACCOUNT_ID
-
-
Constructor Detail
-
ChangeQueryBuilder
protected ChangeQueryBuilder(QueryBuilder.Definition<ChangeData,ChangeQueryBuilder> def, ChangeQueryBuilder.Arguments args)
-
-
Method Detail
-
getArgs
public ChangeQueryBuilder.Arguments getArgs()
-
asUser
public ChangeQueryBuilder asUser(CurrentUser user)
-
age
public Predicate<ChangeData> age(String value)
-
before
public Predicate<ChangeData> before(String value) throws QueryParseException
- Throws:
QueryParseException
-
until
public Predicate<ChangeData> until(String value) throws QueryParseException
- Throws:
QueryParseException
-
after
public Predicate<ChangeData> after(String value) throws QueryParseException
- Throws:
QueryParseException
-
since
public Predicate<ChangeData> since(String value) throws QueryParseException
- Throws:
QueryParseException
-
change
public Predicate<ChangeData> change(String query) throws QueryParseException
- Throws:
QueryParseException
-
comment
public Predicate<ChangeData> comment(String value)
-
status
public Predicate<ChangeData> status(String statusName)
-
statusOpen
public Predicate<ChangeData> statusOpen()
-
has
public Predicate<ChangeData> has(String value) throws QueryParseException
- Throws:
QueryParseException
-
is
public Predicate<ChangeData> is(String value) throws QueryParseException
- Throws:
QueryParseException
-
commit
public Predicate<ChangeData> commit(String id)
-
conflicts
public Predicate<ChangeData> conflicts(String value) throws QueryParseException
- Throws:
QueryParseException
-
p
public Predicate<ChangeData> p(String name)
-
project
public Predicate<ChangeData> project(String name)
-
projects
public Predicate<ChangeData> projects(String name)
-
parentproject
public Predicate<ChangeData> parentproject(String name)
-
repository
public Predicate<ChangeData> repository(String name)
-
repositories
public Predicate<ChangeData> repositories(String name)
-
parentrepository
public Predicate<ChangeData> parentrepository(String name)
-
repo
public Predicate<ChangeData> repo(String name)
-
repos
public Predicate<ChangeData> repos(String name)
-
parentrepo
public Predicate<ChangeData> parentrepo(String name)
-
branch
public Predicate<ChangeData> branch(String name) throws QueryParseException
- Throws:
QueryParseException
-
hashtag
public Predicate<ChangeData> hashtag(String hashtag)
-
topic
public Predicate<ChangeData> topic(String name)
-
intopic
public Predicate<ChangeData> intopic(String name)
-
ref
public Predicate<ChangeData> ref(String ref) throws QueryParseException
- Throws:
QueryParseException
-
f
public Predicate<ChangeData> f(String file)
-
file
public Predicate<ChangeData> file(String file)
-
path
public Predicate<ChangeData> path(String path)
-
ext
public Predicate<ChangeData> ext(String ext) throws QueryParseException
- Throws:
QueryParseException
-
extension
public Predicate<ChangeData> extension(String ext) throws QueryParseException
- Throws:
QueryParseException
-
onlyexts
public Predicate<ChangeData> onlyexts(String extList) throws QueryParseException
- Throws:
QueryParseException
-
onlyextensions
public Predicate<ChangeData> onlyextensions(String extList) throws QueryParseException
- Throws:
QueryParseException
-
footer
public Predicate<ChangeData> footer(String footer) throws QueryParseException
- Throws:
QueryParseException
-
dir
public Predicate<ChangeData> dir(String directory) throws QueryParseException
- Throws:
QueryParseException
-
directory
public Predicate<ChangeData> directory(String directory) throws QueryParseException
- Throws:
QueryParseException
-
label
public Predicate<ChangeData> label(String name) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
message
public Predicate<ChangeData> message(String text)
-
star
public Predicate<ChangeData> star(String label) throws QueryParseException
- Throws:
QueryParseException
-
starredby
public Predicate<ChangeData> starredby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
watchedby
public Predicate<ChangeData> watchedby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
draftby
public Predicate<ChangeData> draftby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
visibleto
public Predicate<ChangeData> visibleto(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
visibleto
public Predicate<ChangeData> visibleto(CurrentUser user)
-
isVisible
public Predicate<ChangeData> isVisible() throws QueryParseException
- Throws:
QueryParseException
-
o
public Predicate<ChangeData> o(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
owner
public Predicate<ChangeData> owner(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
attention
public Predicate<ChangeData> attention(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
assignee
public Predicate<ChangeData> assignee(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
ownerin
public Predicate<ChangeData> ownerin(String group) throws QueryParseException, IOException
- Throws:
QueryParseException
IOException
-
r
public Predicate<ChangeData> r(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
reviewer
public Predicate<ChangeData> reviewer(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
cc
public Predicate<ChangeData> cc(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
reviewerin
public Predicate<ChangeData> reviewerin(String group) throws QueryParseException
- Throws:
QueryParseException
-
tr
public Predicate<ChangeData> tr(String trackingId)
-
bug
public Predicate<ChangeData> bug(String trackingId)
-
limit
public Predicate<ChangeData> limit(String query) throws QueryParseException
- Throws:
QueryParseException
-
added
public Predicate<ChangeData> added(String value) throws QueryParseException
- Throws:
QueryParseException
-
deleted
public Predicate<ChangeData> deleted(String value) throws QueryParseException
- Throws:
QueryParseException
-
size
public Predicate<ChangeData> size(String value) throws QueryParseException
- Throws:
QueryParseException
-
delta
public Predicate<ChangeData> delta(String value) throws QueryParseException
- Throws:
QueryParseException
-
commentby
public Predicate<ChangeData> commentby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
from
public Predicate<ChangeData> from(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
query
public Predicate<ChangeData> query(String name) throws QueryParseException
- Throws:
QueryParseException
-
reviewedby
public Predicate<ChangeData> reviewedby(String who) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
destination
public Predicate<ChangeData> destination(String name) throws QueryParseException
- Throws:
QueryParseException
-
author
public Predicate<ChangeData> author(String who) throws QueryParseException
- Throws:
QueryParseException
-
committer
public Predicate<ChangeData> committer(String who) throws QueryParseException
- Throws:
QueryParseException
-
submittable
public Predicate<ChangeData> submittable(String str) throws QueryParseException
- Throws:
QueryParseException
-
unresolved
public Predicate<ChangeData> unresolved(String value) throws QueryParseException
- Throws:
QueryParseException
-
revertof
public Predicate<ChangeData> revertof(String value) throws QueryParseException
- Throws:
QueryParseException
-
submissionId
public Predicate<ChangeData> submissionId(String value) throws QueryParseException
- Throws:
QueryParseException
-
cherryPickOf
public Predicate<ChangeData> cherryPickOf(String value) throws QueryParseException
- Throws:
QueryParseException
-
defaultField
protected Predicate<ChangeData> defaultField(String query) throws QueryParseException
Description copied from class:QueryBuilder
Handle 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:
defaultField
in 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.
-
reviewerByState
public Predicate<ChangeData> reviewerByState(String who, ReviewerStateInternal state, boolean forDefaultField) throws QueryParseException, IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
QueryParseException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
-