Class MembershipQuery<T>
java.lang.Object
com.atlassian.crowd.search.query.membership.MembershipQuery<T>
- All Implemented Interfaces:
Query<T>
- Direct Known Subclasses:
GroupMembershipQuery
,GroupMembersOfGroupQuery
,UserMembershipQuery
,UserMembersOfGroupQuery
-
Constructor Summary
ConstructorDescriptionMembershipQuery
(MembershipQuery<?> query, Class<T> returnType) MembershipQuery
(MembershipQuery<T> query, int startIndex, int maxResults) MembershipQuery
(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults, SearchRestriction searchRestriction, String... entityNamesToMatch) MembershipQuery
(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults, SearchRestriction searchRestriction, Collection<String> entityNamesToMatch) MembershipQuery
(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, String entityNameToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults) Deprecated.MembershipQuery
(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, String entityNameToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults, SearchRestriction searchRestriction) -
Method Summary
Modifier and TypeMethodDescriptionaddToMaxResults
(int add) Returned queries will have":startIndex
equal to 0 andmaxResults
equal to originalstartIndex + maxResults
.boolean
Deprecated.UsegetEntityNamesToMatch()
instead.int
The maximum number of elements to return.The type of elements to return.Restrictions to apply to the query.int
The index of the first element to return.int
hashCode()
boolean
boolean
Splits query with multiplegetEntityNamesToMatch()
into separate queries with single entity name to match.splitEntityNamesToMatch
(int batchSize) Splits query with multiplegetEntityNamesToMatch()
into separate queries with provided number of entity names to match.toString()
withEntityNames
(String... entityNameToMatch) withEntityNames
(Collection<String> entityNamesToMatch) withEntityToReturn
(EntityDescriptor entityToReturn) withMaxResults
(int maxResults) <Q> MembershipQuery<Q>
withReturnType
(Class<Q> returnType) withSearchRestriction
(SearchRestriction searchRestriction) withStartIndex
(int startIndex) withStartIndexAndMaxResult
(int startIndex, int maxResults)
-
Constructor Details
-
MembershipQuery
@Deprecated public MembershipQuery(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, String entityNameToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults) Deprecated.UseMembershipQuery(Class, boolean, EntityDescriptor, String, EntityDescriptor, int, int, SearchRestriction)
} instead. Since v2.9. -
MembershipQuery
public MembershipQuery(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, String entityNameToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults, SearchRestriction searchRestriction) -
MembershipQuery
public MembershipQuery(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults, SearchRestriction searchRestriction, String... entityNamesToMatch) -
MembershipQuery
public MembershipQuery(Class<T> returnType, boolean findChildren, EntityDescriptor entityToMatch, EntityDescriptor entityToReturn, int startIndex, int maxResults, SearchRestriction searchRestriction, Collection<String> entityNamesToMatch) -
MembershipQuery
-
MembershipQuery
-
-
Method Details
-
getEntityToReturn
-
getEntityToMatch
-
isFindChildren
public boolean isFindChildren() -
getEntityNamesToMatch
-
getEntityNameToMatch
Deprecated.UsegetEntityNamesToMatch()
instead. Since v2.9This will return the entity name to match ifgetEntityNamesToMatch()
contains a single value ornull
.- Returns:
- the entity name to match if
getEntityNamesToMatch()
contains a single value ornull
. - Throws:
IllegalArgumentException
- ifgetEntityNamesToMatch()
has a size greater than one.
-
getStartIndex
public int getStartIndex()Description copied from interface:Query
The index of the first element to return.- Specified by:
getStartIndex
in interfaceQuery<T>
- Returns:
- a positive index value.
-
getMaxResults
public int getMaxResults()Description copied from interface:Query
The maximum number of elements to return.- Specified by:
getMaxResults
in interfaceQuery<T>
- Returns:
- a number of elements.
-
getReturnType
Description copied from interface:Query
The type of elements to return.- Specified by:
getReturnType
in interfaceQuery<T>
- Returns:
- the expected type of elements to be returned by the search.
-
getSearchRestriction
Description copied from interface:Query
Restrictions to apply to the query. Typically finding users of a given name, etc.- Specified by:
getSearchRestriction
in interfaceQuery<T>
- Returns:
- the search restriction to apply to this query.
-
equals
-
hashCode
public int hashCode() -
toString
-
withEntityNames
-
withEntityNames
-
splitEntityNamesToMatch
Splits query with multiplegetEntityNamesToMatch()
into separate queries with single entity name to match. Returned queries will have:startIndex
equal to 0 andmaxResults
equal to originalstartIndex + maxResults
. This is required to correctly merge and produce results of original query. -
splitEntityNamesToMatch
Splits query with multiplegetEntityNamesToMatch()
into separate queries with provided number of entity names to match. Returned queries will have:startIndex
equal to 0 andmaxResults
equal to originalstartIndex + maxResults
. This is required to correctly merge and produce results of original query. -
withAllResults
-
withStartIndex
-
withMaxResults
-
withReturnType
-
withEntityToReturn
-
baseSplitQuery
Returned queries will have":startIndex
equal to 0 andmaxResults
equal to originalstartIndex + maxResults
. This is required to correctly merge and produce results of original query. -
addToMaxResults
-
withStartIndexAndMaxResult
-
withSearchRestriction
-
isWithAllResults
public boolean isWithAllResults()
-
MembershipQuery(Class, boolean, EntityDescriptor, String, EntityDescriptor, int, int, SearchRestriction)
} instead.