Class Content.ContentBuilder
- java.lang.Object
-
- com.atlassian.confluence.api.model.content.Content.ContentBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContentBuilder(ContentType type)Create new builders withContent.builder(ContentType).protectedContentBuilder(ContentType type, long id)Create new builders withContent.builder(ContentType)and aContentIdgenerated from the ContentType and the Long id.protectedContentBuilder(ContentType type, ContentId id)Create new builders withContent.builder(ContentType)and aContentId.
-
Method Summary
-
-
-
Constructor Detail
-
ContentBuilder
protected ContentBuilder(ContentType type)
Create new builders withContent.builder(ContentType).
-
ContentBuilder
protected ContentBuilder(ContentType type, ContentId id)
Create new builders withContent.builder(ContentType)and aContentId.
-
ContentBuilder
protected ContentBuilder(ContentType type, long id)
Create new builders withContent.builder(ContentType)and aContentIdgenerated from the ContentType and the Long id.
-
-
Method Detail
-
collapsed
public Content.ContentBuilder collapsed()
Set all collapsible Reference/Map/List fields to be collapsed rather than empty values.This is useful as a starting point when building Content for a REST response, but the Collapsed instances won't have properties or navigation builders set, so you should still set navigable values into collapsible properties where possible: e.g. see
Space.buildReference(String).- Returns:
- this ContentBuilder with all collapsible fields set to be collapsed
-
type
public Content.ContentBuilder type(ContentType type)
-
build
public Content build()
-
id
public Content.ContentBuilder id(ContentId id)
-
status
public Content.ContentBuilder status(ContentStatus status)
-
title
public Content.ContentBuilder title(String title)
-
addLink
public Content.ContentBuilder addLink(Link link)
-
addLink
public Content.ContentBuilder addLink(LinkType type, String path)
-
history
public Content.ContentBuilder history(Reference<History> history)
-
history
public Content.ContentBuilder history(History history)
-
space
public Content.ContentBuilder space(String spaceKey)
-
space
public Content.ContentBuilder space(Space space)
-
space
public Content.ContentBuilder space(Reference<Space> space)
-
container
public Content.ContentBuilder container(Container container)
-
container
public Content.ContentBuilder container(Reference<? extends Container> container)
-
parent
public Content.ContentBuilder parent(Content parent)
Shortcut method for creating ancestors with a single item of Content- Parameters:
parent- the parent Content- Returns:
- this builder
-
ancestors
public Content.ContentBuilder ancestors(Iterable<Content> ancestors)
-
operations
public Content.ContentBuilder operations(Iterable<OperationCheckResult> operations)
-
children
public Content.ContentBuilder children(Map<ContentType,PageResponse<Content>> children)
-
descendants
public Content.ContentBuilder descendants(Map<ContentType,PageResponse<Content>> descendants)
-
body
public Content.ContentBuilder body(String value, ContentRepresentation format)
-
body
public Content.ContentBuilder body(Map<ContentRepresentation,ContentBody> body)
-
body
public Content.ContentBuilder body(ContentBody body)
-
metadata
public Content.ContentBuilder metadata(Map<String,Object> metadata)
-
extensions
public Content.ContentBuilder extensions(Map<String,Object> extensions)
-
extension
public Content.ContentBuilder extension(String key, Object value)
-
version
public Content.ContentBuilder version(Version version)
-
version
public Content.ContentBuilder version(Reference<Version> version)
-
restrictions
public Content.ContentBuilder restrictions(Map<OperationKey,ContentRestriction> restrictionsByOperationMap)
-
-