public class ItemUpdateBuilder extends TermedDocumentUpdateBuilder
ItemUpdate
objects.Modifier and Type | Method and Description |
---|---|
ItemUpdateBuilder |
append(ItemUpdate update)
Replays all changes in provided update into this builder object.
|
ItemUpdate |
build()
Creates new
TermedStatementDocumentUpdate object with contents of
this builder object. |
static ItemUpdateBuilder |
forBaseRevision(ItemDocument revision)
Creates new builder object for constructing update of given base item entity
revision.
|
static ItemUpdateBuilder |
forBaseRevisionId(ItemIdValue itemId,
long revisionId)
Creates new builder object for constructing update of item entity with given
revision ID.
|
static ItemUpdateBuilder |
forEntityId(ItemIdValue itemId)
Creates new builder object for constructing update of item entity with given
ID.
|
ItemUpdateBuilder |
putSiteLink(SiteLink link)
Adds or replaces site link.
|
ItemUpdateBuilder |
removeSiteLink(String site)
Removes site link.
|
ItemUpdateBuilder |
updateAliases(String language,
AliasUpdate update)
Updates entity aliases.
|
ItemUpdateBuilder |
updateDescriptions(TermUpdate update)
Updates entity descriptions.
|
ItemUpdateBuilder |
updateLabels(TermUpdate update)
Updates entity labels.
|
ItemUpdateBuilder |
updateStatements(StatementUpdate update)
Updates entity statements.
|
forBaseRevision, forBaseRevisionId, forEntityId
forBaseRevision
forBaseRevision
forBaseRevision
public static ItemUpdateBuilder forBaseRevisionId(ItemIdValue itemId, long revisionId)
itemId
- ID of the item entity that is to be updatedrevisionId
- ID of the base item revision to be updated or zero if not
availableNullPointerException
- if itemId
is null
IllegalArgumentException
- if itemId
is a placeholder IDpublic static ItemUpdateBuilder forEntityId(ItemIdValue itemId)
itemId
- ID of the item entity that is to be updatedNullPointerException
- if itemId
is null
IllegalArgumentException
- if itemId
is a placeholder IDpublic static ItemUpdateBuilder forBaseRevision(ItemDocument revision)
revision
- base item entity revision to be updatedNullPointerException
- if revision
is null
IllegalArgumentException
- if revision
has placeholder IDpublic ItemUpdateBuilder updateStatements(StatementUpdate update)
StatementDocumentUpdateBuilder
updateStatements
in class TermedDocumentUpdateBuilder
update
- statement update, possibly emptythis
(fluent method)public ItemUpdateBuilder updateLabels(TermUpdate update)
LabeledDocumentUpdateBuilder
updateLabels
in class TermedDocumentUpdateBuilder
update
- changes in entity labelsthis
(fluent method)public ItemUpdateBuilder updateDescriptions(TermUpdate update)
TermedDocumentUpdateBuilder
updateDescriptions
in class TermedDocumentUpdateBuilder
update
- changes in entity descriptionsthis
(fluent method)public ItemUpdateBuilder updateAliases(String language, AliasUpdate update)
TermedDocumentUpdateBuilder
updateAliases
in class TermedDocumentUpdateBuilder
language
- language code of the altered aliasesupdate
- alias changesthis
(fluent method)public ItemUpdateBuilder putSiteLink(SiteLink link)
removeSiteLink(String)
.
If base entity revision was provided, attempt to overwrite some site link with identical site link will be silently ignored, resulting in empty update.
link
- new or replacement site linkthis
(fluent method)NullPointerException
- if link
is null
public ItemUpdateBuilder removeSiteLink(String site)
putSiteLink(SiteLink)
.
If base entity revision was provided, attempts to remove missing site links will be silently ignored, resulting in empty update.
site
- site key of the removed site linkthis
(fluent method)NullPointerException
- if site
is null
IllegalArgumentException
- if site
is blankpublic ItemUpdateBuilder append(ItemUpdate update)
update
- item update to replaythis
(fluent method)NullPointerException
- if update
is null
IllegalArgumentException
- if update
cannot be applied to base entity revision (if
available)public ItemUpdate build()
TermedDocumentUpdateBuilder
TermedStatementDocumentUpdate
object with contents of
this builder object.build
in class TermedDocumentUpdateBuilder
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