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

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

@ExperimentalApi
public class Content
extends java.lang.Object
implements Container

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(java.lang.Object o)
           
 java.util.List<Content> getAncestors()
           
 java.util.Map<ContentRepresentation,ContentBody> getBody()
           
 java.util.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  java.lang.Class getContainerType()
           
static ContentId getContentId(Reference<Content> contentRef)
          Get the ContentId from a Content Reference.
 java.util.Map<ContentType,PageResponse<Content>> getDescendants()
          Returns a map of all sub-content of this Content, at any depth, split by ContentType.
 History getHistory()
           
 Reference<History> getHistoryRef()
           
 ContentId getId()
           
 java.util.Map<LinkType,Link> getLinks()
           
 java.util.Map<java.lang.String,java.lang.Object> getMetadata()
           
 Space getSpace()
           
 Reference<Space> getSpaceRef()
           
 java.lang.String getTitle()
           
 ContentType getType()
           
 Version getVersion()
           
 int hashCode()
           
 java.lang.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()

getType

public ContentType getType()

getTitle

public java.lang.String getTitle()

getLinks

public java.util.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 java.lang.Class getContainerType()

getAncestors

public java.util.List<Content> getAncestors()

getChildren

public java.util.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 java.util.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 java.util.Map<ContentRepresentation,ContentBody> getBody()

getMetadata

public java.util.Map<java.lang.String,java.lang.Object> getMetadata()

getVersion

public Version getVersion()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2003-2014 Atlassian. All Rights Reserved.