Class EntityUpdateBuilder
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
- Direct Known Subclasses:
StatementDocumentUpdateBuilder
Builder for incremental construction of
EntityUpdate
objects.-
Constructor Summary
ModifierConstructorDescriptionprotected
EntityUpdateBuilder
(EntityDocument revision) Initializes new builder object for constructing update of given base entity revision.protected
EntityUpdateBuilder
(EntityIdValue entityId, long revisionId) Initializes new builder object for constructing update of entity with given ID. -
Method Summary
Modifier and TypeMethodDescriptionabstract EntityUpdate
build()
Creates newEntityUpdate
object with contents of this builder object.static EntityUpdateBuilder
forBaseRevision
(EntityDocument revision) Creates new builder object for constructing update of given base entity revision.static EntityUpdateBuilder
forBaseRevisionId
(EntityIdValue entityId, long revisionId) Creates new builder object for constructing update of entity with given revision ID.static EntityUpdateBuilder
forEntityId
(EntityIdValue entityId) Creates new builder object for constructing update of entity with given ID.
-
Constructor Details
-
EntityUpdateBuilder
Initializes new builder object for constructing update of entity with given ID.- Parameters:
entityId
- ID of the entity that is to be updatedrevisionId
- ID of the base entity revision to be updated or zero if not available- Throws:
NullPointerException
- ifentityId
isnull
IllegalArgumentException
- ifentityId
is as placeholder ID
-
EntityUpdateBuilder
Initializes new builder object for constructing update of given base entity revision.- Parameters:
revision
- base entity revision to be updated- Throws:
NullPointerException
- ifrevision
isnull
IllegalArgumentException
- ifrevision
has a placeholder ID
-
-
Method Details
-
forBaseRevisionId
Creates new builder object for constructing update of entity with given revision ID.Supported entity IDs include
ItemIdValue
,PropertyIdValue
,LexemeIdValue
,FormIdValue
,SenseIdValue
, andMediaInfoIdValue
.- Parameters:
entityId
- ID of the entity that is to be updatedrevisionId
- ID of the base entity revision to be updated or zero if not available- Returns:
- builder object matching entity type
- Throws:
NullPointerException
- ifentityId
isnull
IllegalArgumentException
- ifentityId
is of unrecognized type or it's a placeholder ID
-
forEntityId
Creates new builder object for constructing update of entity with given ID.Supported entity IDs include
ItemIdValue
,PropertyIdValue
,LexemeIdValue
,FormIdValue
,SenseIdValue
, andMediaInfoIdValue
.- Parameters:
entityId
- ID of the entity that is to be updated- Returns:
- builder object matching entity type
- Throws:
NullPointerException
- ifentityId
isnull
IllegalArgumentException
- ifentityId
is of unrecognized type or it's a placeholder ID
-
forBaseRevision
Creates new builder object for constructing update of given base entity revision. Provided entity document might not represent the latest revision of the 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.Supported entity types include
ItemDocument
,PropertyDocument
,LexemeDocument
,FormDocument
,SenseDocument
, andMediaInfoDocument
.- Parameters:
revision
- base entity revision to be updated- Returns:
- builder object matching entity type
- Throws:
NullPointerException
- ifrevision
isnull
IllegalArgumentException
- ifrevision
is of unrecognized type or its ID is a placeholder ID
-
build
Creates newEntityUpdate
object with contents of this builder object.- Returns:
- constructed object
-