Class EntityDocumentBuilder<T extends EntityDocumentBuilder<T,O>,O extends TermedStatementDocument>
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.AbstractDataObjectBuilder<T,O>
org.wikidata.wdtk.datamodel.helpers.EntityDocumentBuilder<T,O>
- Type Parameters:
T
- the type of the eventual concrete builder implementationO
- the type of the object that is being built
- Direct Known Subclasses:
ItemDocumentBuilder
,PropertyDocumentBuilder
public abstract class EntityDocumentBuilder<T extends EntityDocumentBuilder<T,O>,O extends TermedStatementDocument>
extends AbstractDataObjectBuilder<T,O>
Abstract base class for builders that construct
EntityDocument
objects.- Author:
- Markus Kroetzsch
-
Constructor Summary
ModifierConstructorDescriptionprotected
EntityDocumentBuilder
(O initialDocument) Starts constructing an EntityDocument from an initial version of this document.protected
EntityDocumentBuilder
(EntityIdValue entityIdValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<StatementGroup>
Returns a list ofStatementGroup
objects for the currently stored statements.Adds an additional alias to the constructed document.Adds an additional alias to the constructed document.withDescription
(String text, String languageCode) Adds an additional description to the constructed document.Adds an additional description to the constructed document.withEntityId
(EntityIdValue entityId) Changes the entity value id for the constructed document.Adds an additional label to the constructed document.Adds an additional label to the constructed document.withRevisionId
(long revisionId) Sets the revision id for the constructed document.withStatement
(Statement statement) Adds an additional statement to the constructed document.Methods inherited from class org.wikidata.wdtk.datamodel.helpers.AbstractDataObjectBuilder
build, getThis, prepareBuild
-
Constructor Details
-
EntityDocumentBuilder
-
EntityDocumentBuilder
Starts constructing an EntityDocument from an initial version of this document.- Parameters:
initialDocument
- the initial version of the document to use
-
-
Method Details
-
withRevisionId
Sets the revision id for the constructed document. SeeEntityDocument.getRevisionId()
.- Parameters:
revisionId
- the revision id- Returns:
- builder object to continue construction
-
withEntityId
Changes the entity value id for the constructed document. SeeEntityDocument.getEntityId()
.- Parameters:
entityId
- the entity id- Returns:
- builder object to continue construction
-
withLabel
Adds an additional label to the constructed document.- Parameters:
mtv
- the additional label- Returns:
- builder object to continue construction
-
withLabel
Adds an additional label to the constructed document.- Parameters:
text
- the text of the labellanguageCode
- the language code of the label- Returns:
- builder object to continue construction
-
withDescription
Adds an additional description to the constructed document.- Parameters:
mtv
- the additional description- Returns:
- builder object to continue construction
-
withDescription
Adds an additional description to the constructed document.- Parameters:
text
- the text of the descriptionlanguageCode
- the language code of the description- Returns:
- builder object to continue construction
-
withAlias
Adds an additional alias to the constructed document.- Parameters:
mtv
- the additional alias- Returns:
- builder object to continue construction
-
withAlias
Adds an additional alias to the constructed document.- Parameters:
text
- the text of the aliaslanguageCode
- the language code of the alias- Returns:
- builder object to continue construction
-
withStatement
Adds an additional statement to the constructed document.- Parameters:
statement
- the additional statement- Returns:
- builder object to continue construction
-
getStatementGroups
Returns a list ofStatementGroup
objects for the currently stored statements.- Returns:
-