Class SenseUpdateBuilder
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
org.wikidata.wdtk.datamodel.helpers.StatementDocumentUpdateBuilder
org.wikidata.wdtk.datamodel.helpers.SenseUpdateBuilder
Builder for incremental construction of
SenseUpdate objects.-
Method Summary
Modifier and TypeMethodDescriptionappend(SenseUpdate update) Replays all changes in provided update into this builder object.build()Creates newStatementDocumentUpdateobject with contents of this builder object.static SenseUpdateBuilderforBaseRevision(SenseDocument revision) Creates new builder object for constructing update of given base sense entity revision.static SenseUpdateBuilderforBaseRevisionId(SenseIdValue senseId, long revisionId) Creates new builder object for constructing update of sense entity with given revision ID.static SenseUpdateBuilderforEntityId(SenseIdValue senseId) Creates new builder object for constructing update of sense entity with given ID.updateGlosses(TermUpdate update) Updates sense glosses.updateStatements(StatementUpdate update) Updates entity statements.Methods inherited from class org.wikidata.wdtk.datamodel.helpers.StatementDocumentUpdateBuilder
forBaseRevision, forBaseRevisionId, forEntityIdMethods inherited from class org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
forBaseRevision
-
Method Details
-
forBaseRevisionId
Creates new builder object for constructing update of sense entity with given revision ID.- Parameters:
senseId- ID of the sense that is to be updatedrevisionId- ID of the base sense revision to be updated or zero if not available- Returns:
- update builder object
- Throws:
NullPointerException- ifsenseIdisnullIllegalArgumentException- ifsenseIdis a placeholder ID
-
forEntityId
Creates new builder object for constructing update of sense entity with given ID.- Parameters:
senseId- ID of the sense that is to be updated- Returns:
- update builder object
- Throws:
NullPointerException- ifsenseIdisnullIllegalArgumentException- ifsenseIdis a placeholder ID
-
forBaseRevision
Creates new builder object for constructing update of given base sense entity revision. Provided sense document might not represent the latest revision of the sense entity as currently stored in Wikibase. It will be used for validation in builder methods. If the document has revision ID, it will be used to detect edit conflicts.- Parameters:
revision- base sense entity revision to be updated- Returns:
- update builder object
- Throws:
NullPointerException- ifrevisionisnullIllegalArgumentException- ifrevisionhas placeholder ID
-
updateStatements
Description copied from class:StatementDocumentUpdateBuilderUpdates entity statements. If this method is called multiple times, changes are accumulated. If base entity revision was provided, the update is checked against it and redundant changes are silently ignored, resulting in empty update.- Overrides:
updateStatementsin classStatementDocumentUpdateBuilder- Parameters:
update- statement update, possibly empty- Returns:
this(fluent method)
-
updateGlosses
Updates sense glosses. If this method is called multiple times, changes are accumulated. If base entity revision was provided, redundant changes are silently ignored, resulting in empty update.- Parameters:
update- changes in sense glosses- Returns:
this(fluent method)- Throws:
NullPointerException- ifupdateisnull
-
append
Replays all changes in provided update into this builder object. Changes from the update are added on top of changes already present in this builder object.- Parameters:
update- sense update to replay- Returns:
this(fluent method)- Throws:
NullPointerException- ifupdateisnullIllegalArgumentException- ifupdatecannot be applied to base entity revision (if available)
-
build
Description copied from class:StatementDocumentUpdateBuilderCreates newStatementDocumentUpdateobject with contents of this builder object.- Specified by:
buildin classStatementDocumentUpdateBuilder- Returns:
- constructed object
-