Package org.openrefine.wikidata.updates
Class MediaInfoEdit
java.lang.Object
org.openrefine.wikidata.updates.LabeledStatementEntityEdit
org.openrefine.wikidata.updates.MediaInfoEdit
- All Implemented Interfaces:
EntityEdit,StatementEntityEdit
Represents a candidate edit on a MediaInfo entity.
- Author:
- Antonin Delpeuch
-
Field Summary
Fields inherited from class org.openrefine.wikidata.updates.LabeledStatementEntityEdit
id, labels, labelsIfNew, statements -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMediaInfoEdit(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, List<StatementEdit> statements, Map<String, org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labels, Map<String, org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labelsIfNew) Protected constructor to avoid re-constructing term maps when merging two entity updates.MediaInfoEdit(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, List<StatementEdit> statements, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labels, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labelsIfNew) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanisEmpty()merge(EntityEdit otherEdit) Merges all the changes in other with this instance.org.wikidata.wdtk.datamodel.interfaces.MediaInfoUpdatetoEntityUpdate(org.wikidata.wdtk.datamodel.interfaces.EntityDocument entityDocument) In case the subject id is not new, returns the corresponding update given the current state of the entity.org.wikidata.wdtk.datamodel.interfaces.EntityDocumentIn case the subject id is new, returns the corresponding new item document to be created.toString()Methods inherited from class org.openrefine.wikidata.updates.LabeledStatementEntityEdit
getEntityId, getLabels, getLabelsIfNew, getStatementEdits, getStatementGroupEdits, getStatementGroupsForNewEntity, mergeSingleTermMaps, toStatementUpdateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openrefine.wikidata.updates.EntityEdit
isNew, isNullMethods inherited from interface org.openrefine.wikidata.updates.StatementEntityEdit
getAddedStatements, getDeletedStatements
-
Constructor Details
-
MediaInfoEdit
public MediaInfoEdit(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, List<StatementEdit> statements, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labels, Set<org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labelsIfNew) Constructor.- Parameters:
id- the subject of the document. It can be a reconciled entity value for new entities.statements- the statements to change on the entity.labels- the labels to add on the entity, overriding any existing one in that languagelabelsIfNew- the labels to add on the entity, only if no label for that language exists
-
MediaInfoEdit
protected MediaInfoEdit(org.wikidata.wdtk.datamodel.interfaces.EntityIdValue id, List<StatementEdit> statements, Map<String, org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labels, Map<String, org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue> labelsIfNew) Protected constructor to avoid re-constructing term maps when merging two entity updates. No validation is done on the arguments, they all have to be non-null.- Parameters:
id- the subject of the updateaddedStatements- the statements to adddeletedStatements- the statements to deletelabels- the labels to add on the entity, overriding any existing one in that languagelabelsIfNew- the labels to add on the entity, only if no label for that language exists
-
-
Method Details
-
toEntityUpdate
public org.wikidata.wdtk.datamodel.interfaces.MediaInfoUpdate toEntityUpdate(org.wikidata.wdtk.datamodel.interfaces.EntityDocument entityDocument) Description copied from interface:EntityEditIn case the subject id is not new, returns the corresponding update given the current state of the entity. Throws a validation exception otherwise. -
merge
Description copied from interface:EntityEditMerges all the changes in other with this instance. Both updates should have the same subject. Changes coming from `other` have priority over changes from this instance. This instance is not modified, the merged update is returned instead. -
toNewEntity
public org.wikidata.wdtk.datamodel.interfaces.EntityDocument toNewEntity()Description copied from interface:EntityEditIn case the subject id is new, returns the corresponding new item document to be created. Throws a validation exception otherwise. -
isEmpty
public boolean isEmpty()- Returns:
- true when this change leaves the content of the document untouched. In the case of a new entity, this could still mean making an edit to create the blank entity.
-
toString
-
equals
-
hashCode
public int hashCode()
-