public class ItemDocumentBuilder extends EntityDocumentBuilder<ItemDocumentBuilder,ItemDocument>
ItemDocument
objects.Modifier | Constructor and Description |
---|---|
protected |
ItemDocumentBuilder(ItemDocument initialDocument)
Constructor to start the build from an existing item.
|
protected |
ItemDocumentBuilder(ItemIdValue itemIdValue)
Constructor to start the build from a blank item.
|
Modifier and Type | Method and Description |
---|---|
ItemDocument |
build()
Returns the
ItemDocument that has been built. |
static ItemDocumentBuilder |
forItemId(ItemIdValue itemIdValue)
Starts the construction of an
ItemDocument with the given id. |
static ItemDocumentBuilder |
fromItemDocument(ItemDocument initialDocument)
Starts the construction of an
ItemDocument from an existing value. |
protected ItemDocumentBuilder |
getThis()
Returns the current object with the correct builder type.
|
ItemDocumentBuilder |
withEntityId(EntityIdValue entityId)
Changes the entity value id for the constructed document.
|
ItemDocumentBuilder |
withSiteLink(SiteLink siteLink)
Adds an additional site link to the constructed document.
|
ItemDocumentBuilder |
withSiteLink(String title,
String siteKey,
ItemIdValue... badges)
Adds an additional site link to the constructed document.
|
getStatementGroups, withAlias, withAlias, withDescription, withDescription, withLabel, withLabel, withRevisionId, withStatement
prepareBuild
protected ItemDocumentBuilder(ItemIdValue itemIdValue)
itemIdValue
- protected ItemDocumentBuilder(ItemDocument initialDocument)
initialDocument
- the item to start the build frompublic static ItemDocumentBuilder forItemId(ItemIdValue itemIdValue)
ItemDocument
with the given id.itemIdValue
- id of the newly constructed item documentpublic static ItemDocumentBuilder fromItemDocument(ItemDocument initialDocument)
ItemDocument
from an existing value.initialDocument
- the item to start the construction frompublic ItemDocument build()
ItemDocument
that has been built.build
in class AbstractDataObjectBuilder<ItemDocumentBuilder,ItemDocument>
IllegalStateException
- if the object was built alreadypublic ItemDocumentBuilder withSiteLink(SiteLink siteLink)
siteLink
- the additional site linkpublic ItemDocumentBuilder withSiteLink(String title, String siteKey, ItemIdValue... badges)
title
- the title of the linked pagesiteKey
- identifier of the site, e.g., "enwiki"badges
- one or more badgespublic ItemDocumentBuilder withEntityId(EntityIdValue entityId)
EntityDocument.getEntityId()
.withEntityId
in class EntityDocumentBuilder<ItemDocumentBuilder,ItemDocument>
entityId
- the entity id, which must be an ItemIdValueprotected ItemDocumentBuilder getThis()
AbstractDataObjectBuilder
getThis
in class AbstractDataObjectBuilder<ItemDocumentBuilder,ItemDocument>
Copyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage