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

public class MembershipQuery<T> extends Object implements Query<T>
  • Constructor Details

  • Method Details

    • getEntityToReturn

      public EntityDescriptor getEntityToReturn()
    • getEntityToMatch

      public EntityDescriptor getEntityToMatch()
    • isFindChildren

      public boolean isFindChildren()
    • getEntityNamesToMatch

      public Set<String> getEntityNamesToMatch()
    • getEntityNameToMatch

      @Deprecated @Nullable public String getEntityNameToMatch()
      Deprecated.
      Use getEntityNamesToMatch() instead. Since v2.9
      This will return the entity name to match if getEntityNamesToMatch() contains a single value or null.
      Returns:
      the entity name to match if getEntityNamesToMatch() contains a single value or null.
      Throws:
      IllegalArgumentException - if getEntityNamesToMatch() 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 interface Query<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 interface Query<T>
      Returns:
      a number of elements.
    • getReturnType

      public Class<T> getReturnType()
      Description copied from interface: Query
      The type of elements to return.
      Specified by:
      getReturnType in interface Query<T>
      Returns:
      the expected type of elements to be returned by the search.
    • getSearchRestriction

      public SearchRestriction getSearchRestriction()
      Description copied from interface: Query
      Restrictions to apply to the query. Typically finding users of a given name, etc.
      Specified by:
      getSearchRestriction in interface Query<T>
      Returns:
      the search restriction to apply to this query.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • withEntityNames

      public MembershipQuery<T> withEntityNames(Collection<String> entityNamesToMatch)
    • withEntityNames

      public MembershipQuery<T> withEntityNames(String... entityNameToMatch)
    • splitEntityNamesToMatch

      public List<MembershipQuery<T>> splitEntityNamesToMatch()
      Splits query with multiple getEntityNamesToMatch() into separate queries with single entity name to match. Returned queries will have: startIndex equal to 0 and maxResults equal to original startIndex + maxResults. This is required to correctly merge and produce results of original query.
    • splitEntityNamesToMatch

      public List<MembershipQuery<T>> splitEntityNamesToMatch(int batchSize)
      Splits query with multiple getEntityNamesToMatch() into separate queries with provided number of entity names to match. Returned queries will have: startIndex equal to 0 and maxResults equal to original startIndex + maxResults. This is required to correctly merge and produce results of original query.
    • withAllResults

      public MembershipQuery<T> withAllResults()
    • withStartIndex

      public MembershipQuery<T> withStartIndex(int startIndex)
    • withMaxResults

      public MembershipQuery<T> withMaxResults(int maxResults)
    • withReturnType

      public <Q> MembershipQuery<Q> withReturnType(Class<Q> returnType)
    • withEntityToReturn

      public MembershipQuery<T> withEntityToReturn(EntityDescriptor entityToReturn)
    • baseSplitQuery

      public MembershipQuery<T> baseSplitQuery()
      Returned queries will have": startIndex equal to 0 and maxResults equal to original startIndex + maxResults. This is required to correctly merge and produce results of original query.
    • addToMaxResults

      public MembershipQuery<T> addToMaxResults(int add)
    • withStartIndexAndMaxResult

      public MembershipQuery<T> withStartIndexAndMaxResult(int startIndex, int maxResults)
    • withSearchRestriction

      public MembershipQuery<T> withSearchRestriction(SearchRestriction searchRestriction)
    • isWithAllResults

      public boolean isWithAllResults()