Class PropertyUpdateBuilder
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
org.wikidata.wdtk.datamodel.helpers.StatementDocumentUpdateBuilder
org.wikidata.wdtk.datamodel.helpers.LabeledDocumentUpdateBuilder
org.wikidata.wdtk.datamodel.helpers.TermedDocumentUpdateBuilder
org.wikidata.wdtk.datamodel.helpers.PropertyUpdateBuilder
Builder for incremental construction of
PropertyUpdate objects.-
Method Summary
Modifier and TypeMethodDescriptionappend(PropertyUpdate update) Replays all changes in provided update into this builder object.build()Creates newTermedStatementDocumentUpdateobject with contents of this builder object.static PropertyUpdateBuilderforBaseRevision(PropertyDocument revision) Creates new builder object for constructing update of given base property entity revision.static PropertyUpdateBuilderforBaseRevisionId(PropertyIdValue propertyId, long revisionId) Creates new builder object for constructing update of property entity with given revision ID.static PropertyUpdateBuilderforEntityId(PropertyIdValue propertyId) Creates new builder object for constructing update of property entity with given ID.updateAliases(String language, AliasUpdate update) Updates entity aliases.updateDescriptions(TermUpdate update) Updates entity descriptions.updateLabels(TermUpdate update) Updates entity labels.updateStatements(StatementUpdate update) Updates entity statements.Methods inherited from class org.wikidata.wdtk.datamodel.helpers.TermedDocumentUpdateBuilder
forBaseRevision, forBaseRevisionId, forEntityIdMethods inherited from class org.wikidata.wdtk.datamodel.helpers.LabeledDocumentUpdateBuilder
forBaseRevisionMethods inherited from class org.wikidata.wdtk.datamodel.helpers.StatementDocumentUpdateBuilder
forBaseRevisionMethods inherited from class org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
forBaseRevision
-
Method Details
-
forBaseRevisionId
Creates new builder object for constructing update of property entity with given revision ID.- Parameters:
propertyId- ID of the property entity that is to be updatedrevisionId- ID of the base property revision to be updated or zero if not available- Returns:
- update builder object
- Throws:
NullPointerException- ifpropertyIdisnullIllegalArgumentException- ifpropertyIdis a placeholder ID
-
forEntityId
Creates new builder object for constructing update of property entity with given ID.- Parameters:
propertyId- ID of the property entity that is to be updated- Returns:
- update builder object
- Throws:
NullPointerException- ifpropertyIdisnullIllegalArgumentException- ifpropertyIdis a placeholder ID
-
forBaseRevision
Creates new builder object for constructing update of given base property entity revision. Provided property document might not represent the latest revision of the property 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 property 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 classTermedDocumentUpdateBuilder- Parameters:
update- statement update, possibly empty- Returns:
this(fluent method)
-
updateLabels
Description copied from class:LabeledDocumentUpdateBuilderUpdates entity labels. 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.- Overrides:
updateLabelsin classTermedDocumentUpdateBuilder- Parameters:
update- changes in entity labels- Returns:
this(fluent method)
-
updateDescriptions
Description copied from class:TermedDocumentUpdateBuilderUpdates entity descriptions. 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.- Overrides:
updateDescriptionsin classTermedDocumentUpdateBuilder- Parameters:
update- changes in entity descriptions- Returns:
this(fluent method)
-
updateAliases
Description copied from class:TermedDocumentUpdateBuilderUpdates entity aliases. 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:
updateAliasesin classTermedDocumentUpdateBuilder- Parameters:
language- language code of the altered aliasesupdate- alias changes- Returns:
this(fluent method)
-
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- property update to replay- Returns:
this(fluent method)- Throws:
NullPointerException- ifupdateisnullIllegalArgumentException- ifupdatecannot be applied to base entity revision (if available)
-
build
Description copied from class:TermedDocumentUpdateBuilderCreates newTermedStatementDocumentUpdateobject with contents of this builder object.- Specified by:
buildin classTermedDocumentUpdateBuilder- Returns:
- constructed object
-