com.atlassian.confluence.api.model.content
Class Content

java.lang.Object
  extended by com.atlassian.confluence.api.model.content.Content
All Implemented Interfaces:
Container, NavigationAware

@ExperimentalApi
public class Content
extends Object
implements Container, NavigationAware

Represents all the different kinds of content that can be housed in Confluence: pages, blog posts, comments and so on.


Nested Class Summary
static class Content.ContentBuilder
          Builds Content objects.
static class Content.Expansions
          Provides property names that can be used to expand Content objects.
 
Method Summary
static Content.ContentBuilder builder()
          Returns a Content.ContentBuilder instance that can be used to create a new Content object.
static Content.ContentBuilder builder(Content content)
          Returns a Content.ContentBuilder instance that clones an existing Content object.
static Content.ContentBuilder builder(ContentType type)
          Returns a Content.ContentBuilder instance that can be used to create a new Content object.
static Content.ContentBuilder builder(ContentType type, long id)
          Returns a Content.ContentBuilder instance that can be used to create a new Content object.
static Reference<Content> buildReference(ContentId id)
           
 boolean equals(Object o)
           
 List<Content> getAncestors()
           
 Map<ContentRepresentation,ContentBody> getBody()
           
 Map<ContentType,PageResponse<Content>> getChildren()
          Returns a map of the immediate sub-content of this Content, split by ContentType.
 Container getContainer()
          Returns the container for this Content, which for Pages and Blog Posts will be the Space, and for Comments the Page or BlogPost.
protected  Class getContainerType()
           
static ContentId getContentId(Reference<Content> contentRef)
          Get the ContentId from a Content Reference.
 Map<ContentType,PageResponse<Content>> getDescendants()
          Returns a map of all sub-content of this Content, at any depth, split by ContentType.
 Object getExtension(String extensionKey)
           
 Map<String,Object> getExtensions()
           
 History getHistory()
           
 Reference<History> getHistoryRef()
           
 ContentId getId()
           
 Map<LinkType,Link> getLinks()
           
 Map<String,Object> getMetadata()
           
 com.atlassian.fugue.Option<Content> getParent()
           
 ContentId getParentId()
           
 Space getSpace()
           
 Reference<Space> getSpaceRef()
           
 ContentStatus getStatus()
           
 String getTitle()
           
 ContentType getType()
           
 Version getVersion()
           
 Reference<Version> getVersionRef()
           
 int hashCode()
           
 Navigation.Builder resolveNavigation(NavigationService navigationService)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getContentId

public static ContentId getContentId(Reference<Content> contentRef)
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.

builder

public static Content.ContentBuilder builder()
Returns a Content.ContentBuilder instance that can be used to create a new Content object.


builder

public static Content.ContentBuilder builder(ContentType type)
Returns a Content.ContentBuilder instance that can be used to create a new Content object.

Parameters:
type - the type of Content to create

builder

public static Content.ContentBuilder builder(ContentType type,
                                             long id)
Returns a Content.ContentBuilder instance that can be used to create a new Content object.

Parameters:
type - the type of Content to create
id - the id of the Content to create

builder

public static Content.ContentBuilder builder(Content content)
Returns a Content.ContentBuilder instance that clones an existing Content object.

Parameters:
content - the Content to clone

buildReference

public static Reference<Content> buildReference(ContentId id)
Returns:
a collapsed reference to a piece of content with the given ID

getId

public ContentId getId()

getStatus

public ContentStatus getStatus()

getType

public ContentType getType()

getTitle

public String getTitle()

getLinks

public Map<LinkType,Link> getLinks()

getHistoryRef

public Reference<History> getHistoryRef()

getHistory

public History getHistory()

getSpaceRef

public Reference<Space> getSpaceRef()

getSpace

public Space getSpace()

getContainer

public Container 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().


getContainerType

protected Class getContainerType()

getParentId

public ContentId getParentId()
Returns:
the contentId of the parent if it is set, or ContentId.UNSET

getParent

public com.atlassian.fugue.Option<Content> getParent()

getAncestors

public List<Content> getAncestors()

getChildren

public Map<ContentType,PageResponse<Content>> 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

public Map<ContentType,PageResponse<Content>> 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.


getBody

public Map<ContentRepresentation,ContentBody> getBody()

getMetadata

public Map<String,Object> getMetadata()

getExtensions

public Map<String,Object> getExtensions()

getExtension

public Object getExtension(String extensionKey)

getVersionRef

public Reference<Version> getVersionRef()

getVersion

public Version getVersion()

resolveNavigation

public Navigation.Builder resolveNavigation(NavigationService navigationService)
Specified by:
resolveNavigation in interface NavigationAware

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


Copyright © 2003–2015 Atlassian. All rights reserved.