public class

ContainingContentTypeQuery

extends Object
implements SearchQuery
java.lang.Object
   ↳ com.atlassian.confluence.search.v2.query.ContainingContentTypeQuery

Class Overview

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 getType() method.

Summary

Public Constructors
ContainingContentTypeQuery(ContentTypeEnum contentType)
Search for a particular type of content
ContainingContentTypeQuery(Collection<ContentTypeEnum> contentTypes)
Search for content that is one of the provided types
Public Methods
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)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.search.v2.SearchQuery

Public Constructors

public ContainingContentTypeQuery (ContentTypeEnum contentType)

Search for a particular type of content

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

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

Public Methods

public boolean equals (Object obj)

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

public String getKey ()

public List<String> getParameters ()

List of parameters as Strings or SearchQuerys.

Returns

public int hashCode ()

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
containerType the type of content to look for it within
contentTypes the set of types of content to search for
Returns
  • a query to search for all content of type contentType contained within content of type containerType