com.atlassian.confluence.search.v2.query
Class ContainingContentTypeQuery

java.lang.Object
  extended by com.atlassian.confluence.search.v2.query.ContainingContentTypeQuery
All Implemented Interfaces:
SearchQuery

public class ContainingContentTypeQuery
extends Object
implements SearchQuery

Search for an entity contained within content of a particular type. For example, a comment or attachment on a page would be within a page, while a comment or attachment on a blogpost would not. The string representation of a content's type is that returned by the ContentTypeAware.getType() method.


Constructor Summary
ContainingContentTypeQuery(Collection<ContentTypeEnum> contentTypes)
          Search for content that is one of the provided types
ContainingContentTypeQuery(ContentTypeEnum contentType)
          Search for a particular type of content
 
Method Summary
 boolean equals(Object obj)
           
 Set<ContentTypeEnum> getContentTypes()
          Get the content types being searched for, as strings.
 String getKey()
           
 List<String> getParameters()
          List of parameters as Strings or SearchQuerys.
 int hashCode()
           
static SearchQuery searchForTypesWithinContainerType(ContentTypeEnum containerType, Set<ContentTypeEnum> contentTypes)
          Helper method for the common "Find me all attachments attached to pages" query - which would be ContainingContentTypeQuery.queryForTypeWithinContainerType(ContentTypeEnum.ATTACHMENT, ContentTypeEnum.PAGE)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainingContentTypeQuery

public ContainingContentTypeQuery(ContentTypeEnum contentType)
Search for a particular type of content

Parameters:
contentType - the type string for the content to be searched for

ContainingContentTypeQuery

public ContainingContentTypeQuery(Collection<ContentTypeEnum> contentTypes)
Search for content that is one of the provided types

Parameters:
contentTypes - a list of content types to search for
Method Detail

searchForTypesWithinContainerType

public static SearchQuery searchForTypesWithinContainerType(ContentTypeEnum containerType,
                                                            Set<ContentTypeEnum> contentTypes)
Helper method for the common "Find me all attachments attached to pages" query - which would be ContainingContentTypeQuery.queryForTypeWithinContainerType(ContentTypeEnum.ATTACHMENT, ContentTypeEnum.PAGE)

Parameters:
contentTypes - the set of types of content to search for
containerType - the type of content to look for it within
Returns:
a query to search for all content of type contentType contained within content of type containerType

getKey

public String getKey()
Specified by:
getKey in interface SearchQuery
Returns:
the plugin key

getParameters

public List<String> getParameters()
Description copied from interface: SearchQuery
List of parameters as Strings or SearchQuerys.

Specified by:
getParameters in interface SearchQuery
Returns:
Strings or SearchQuerys.

getContentTypes

public Set<ContentTypeEnum> getContentTypes()
Get the content types being searched for, as strings. Really does the same as getParameters() but has a more apt name.

Returns:
a list of the content types being searched for, as strings

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003–2015 Atlassian. All rights reserved.