Class MediaInfoUpdateBuilder
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.MediaInfoUpdateBuilder
Builder for incremental construction of
MediaInfoUpdate
objects.-
Method Summary
Modifier and TypeMethodDescriptionapply
(MediaInfoUpdate update) Replays all changes in provided update into this builder object.build()
Creates newLabeledStatementDocumentUpdate
object with contents of this builder object.static MediaInfoUpdateBuilder
forBaseRevision
(MediaInfoDocument revision) Creates new builder object for constructing update of given base media entity revision.static MediaInfoUpdateBuilder
forBaseRevisionId
(MediaInfoIdValue mediaInfoId, long revisionId) Creates new builder object for constructing update of media entity with given revision ID.static MediaInfoUpdateBuilder
forEntityId
(MediaInfoIdValue mediaInfoId) Creates new builder object for constructing update of media entity with given ID.updateLabels
(TermUpdate update) Updates entity labels.updateStatements
(StatementUpdate update) Updates entity statements.Methods inherited from class org.wikidata.wdtk.datamodel.helpers.LabeledDocumentUpdateBuilder
forBaseRevision, forBaseRevisionId, forEntityId
Methods inherited from class org.wikidata.wdtk.datamodel.helpers.StatementDocumentUpdateBuilder
forBaseRevision
Methods inherited from class org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
forBaseRevision
-
Method Details
-
forBaseRevisionId
public static MediaInfoUpdateBuilder forBaseRevisionId(MediaInfoIdValue mediaInfoId, long revisionId) Creates new builder object for constructing update of media entity with given revision ID.- Parameters:
mediaInfoId
- ID of the media entity that is to be updatedrevisionId
- ID of the base media entity revision to be updated or zero if not available- Returns:
- update builder object
- Throws:
NullPointerException
- ifmediaInfoId
isnull
IllegalArgumentException
- ifmediaInfoId
is a placeholder ID
-
forEntityId
Creates new builder object for constructing update of media entity with given ID.- Parameters:
mediaInfoId
- ID of the media entity that is to be updated- Returns:
- update builder object
- Throws:
NullPointerException
- ifmediaInfoId
isnull
IllegalArgumentException
- ifmediaInfoId
is a placeholder ID
-
forBaseRevision
Creates new builder object for constructing update of given base media entity revision. Provided media document might not represent the latest revision of the media 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 media entity revision to be updated- Returns:
- update builder object
- Throws:
NullPointerException
- ifrevision
isnull
IllegalArgumentException
- ifrevision
has placeholder ID
-
updateStatements
Description copied from class:StatementDocumentUpdateBuilder
Updates 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:
updateStatements
in classLabeledDocumentUpdateBuilder
- Parameters:
update
- statement update, possibly empty- Returns:
this
(fluent method)
-
updateLabels
Description copied from class:LabeledDocumentUpdateBuilder
Updates 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:
updateLabels
in classLabeledDocumentUpdateBuilder
- Parameters:
update
- changes in entity labels- Returns:
this
(fluent method)
-
apply
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
- media update to replay- Returns:
this
(fluent method)- Throws:
NullPointerException
- ifupdate
isnull
IllegalArgumentException
- ifupdate
cannot be applied to base entity revision (if available)
-
build
Description copied from class:LabeledDocumentUpdateBuilder
Creates newLabeledStatementDocumentUpdate
object with contents of this builder object.- Specified by:
build
in classLabeledDocumentUpdateBuilder
- Returns:
- constructed object
-