Class EntityUpdateBuilder
java.lang.Object
org.wikidata.wdtk.datamodel.helpers.EntityUpdateBuilder
- Direct Known Subclasses:
StatementDocumentUpdateBuilder
Builder for incremental construction of
EntityUpdate objects.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityUpdateBuilder(EntityDocument revision) Initializes new builder object for constructing update of given base entity revision.protectedEntityUpdateBuilder(EntityIdValue entityId, long revisionId) Initializes new builder object for constructing update of entity with given ID. -
Method Summary
Modifier and TypeMethodDescriptionabstract EntityUpdatebuild()Creates newEntityUpdateobject with contents of this builder object.static EntityUpdateBuilderforBaseRevision(EntityDocument revision) Creates new builder object for constructing update of given base entity revision.static EntityUpdateBuilderforBaseRevisionId(EntityIdValue entityId, long revisionId) Creates new builder object for constructing update of entity with given revision ID.static EntityUpdateBuilderforEntityId(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- ifentityIdisnullIllegalArgumentException- ifentityIdis 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- ifrevisionisnullIllegalArgumentException- ifrevisionhas 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- ifentityIdisnullIllegalArgumentException- ifentityIdis 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- ifentityIdisnullIllegalArgumentException- ifentityIdis 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- ifrevisionisnullIllegalArgumentException- ifrevisionis of unrecognized type or its ID is a placeholder ID
-
build
Creates newEntityUpdateobject with contents of this builder object.- Returns:
- constructed object
-