Class MediaInfoEdit

All Implemented Interfaces:
EntityEdit, StatementEntityEdit

public class MediaInfoEdit extends LabeledStatementEntityEdit
Represents a candidate edit on a MediaInfo entity.
Author:
Antonin Delpeuch
  • 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 language
      labelsIfNew - 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 update
      addedStatements - the statements to add
      deletedStatements - the statements to delete
      labels - the labels to add on the entity, overriding any existing one in that language
      labelsIfNew - 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: EntityEdit
      In case the subject id is not new, returns the corresponding update given the current state of the entity. Throws a validation exception otherwise.
    • merge

      public MediaInfoEdit merge(EntityEdit otherEdit)
      Description copied from interface: EntityEdit
      Merges 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: EntityEdit
      In 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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object