Class Content
java.lang.Object
com.atlassian.confluence.api.model.content.Content
- All Implemented Interfaces:
Container
,Relatable
,NavigationAware
Represents all the different kinds of content that can be housed in Confluence: pages, blog posts, comments and so
on.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Content.ContentBuilder
builder()
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.static Content.ContentBuilder
Returns aContent.ContentBuilder
instance that clones an existingContent
object.static Content.ContentBuilder
builder
(ContentType type) Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.static Content.ContentBuilder
builder
(ContentType type, long id) Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.static Content.ContentBuilder
builder
(ContentType type, ContentId id) Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.buildReference
(ContentSelector selector) Deprecated.since 5.10.boolean
getBody()
Returns a map of the immediate sub-content of this Content, split by ContentType.Returns the container for this Content, which for Pages and Blog Posts will be the Space, and for Comments the Page or BlogPost.static ContentId
getContentId
(Reference<Content> contentRef) Deprecated.since 5.10.Returns a map of all sub-content of this Content, at any depth, split by ContentType.getExtension
(String extensionKey) getId()
getLinks()
int
Returns a Map of restrictions present on the given Content, grouped by Operation.static ContentSelector
getSelector
(Reference<Content> contentRef) Get the selector from a Content Reference.getSpace()
getTitle()
getType()
int
hashCode()
resolveNavigation
(NavigationService navigationService) toString()
-
Method Details
-
getContentId
Deprecated.since 5.10. UsegetSelector()
.Get the ContentId from a Content Reference.- Parameters:
contentRef
- the Reference to return the id from- Returns:
- the contentId or null if the referenced content does not have a contentId.
-
getSelector
Get the selector from a Content Reference.- Parameters:
contentRef
- the Reference to return the selector from- Returns:
- the selector or null if the reference cannot return a selector.
-
builder
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object. -
builder
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.- Parameters:
type
- the type of Content to create
-
builder
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.- Parameters:
type
- the type of Content to createid
- the id of the Content to create
-
builder
Returns aContent.ContentBuilder
instance that can be used to create a newContent
object.- Parameters:
type
- the type of Content to createid
- the id of the Content to create
-
builder
Returns aContent.ContentBuilder
instance that clones an existingContent
object.- Parameters:
content
- the Content to clone
-
buildReference
Deprecated.since 5.10. UsebuildReference(ContentSelector)
- Returns:
- a collapsed reference to a piece of content with the given ID
-
buildReference
- Returns:
- a collapsed reference to a piece of content with the given selector
-
getSelector
-
getId
-
getPosition
public int getPosition()- Since:
- 8.9.0
-
getStatus
-
getType
-
getTitle
-
getLinks
-
getHistoryRef
-
getHistory
-
getSpaceRef
-
getSpace
-
getContainer
Returns the container for this Content, which for Pages and Blog Posts will be the Space, and for Comments the Page or BlogPost. The container class MUST be serializable for REST.For the parent of this Content, use
getAncestors()
. -
getContainerRef
-
getContainerType
-
getParentId
- Returns:
- the contentId of the parent if it is set, or ContentId.UNSET
-
getOptionalParent
-
getAncestors
-
getOperations
-
getChildren
Returns a map of the immediate sub-content of this Content, split by ContentType.Children includes Content of the same type, and Content of other types that is contained within this Content but has no other parent reference.
-
getDescendants
Returns a map of all sub-content of this Content, at any depth, split by ContentType.Descendants includes Content of the same type, and Content of other types that is contained within this Content at any depth.
-
getRestrictions
Returns a Map of restrictions present on the given Content, grouped by Operation.Is empty by default. Can be collapsed, if not asked to expand while retrieving.
-
getBody
-
getMetadata
-
getExtensions
-
getExtension
-
getVersionRef
-
getVersion
-
equals
-
hashCode
public int hashCode() -
toString
-