Class PropertyUpdateBuilder


public class PropertyUpdateBuilder extends TermedDocumentUpdateBuilder
Builder for incremental construction of PropertyUpdate objects.
  • Method Details

    • forBaseRevisionId

      public static PropertyUpdateBuilder forBaseRevisionId(PropertyIdValue propertyId, long revisionId)
      Creates new builder object for constructing update of property entity with given revision ID.
      Parameters:
      propertyId - ID of the property entity that is to be updated
      revisionId - ID of the base property revision to be updated or zero if not available
      Returns:
      update builder object
      Throws:
      NullPointerException - if propertyId is null
      IllegalArgumentException - if propertyId is a placeholder ID
    • forEntityId

      public static PropertyUpdateBuilder forEntityId(PropertyIdValue propertyId)
      Creates new builder object for constructing update of property entity with given ID.
      Parameters:
      propertyId - ID of the property entity that is to be updated
      Returns:
      update builder object
      Throws:
      NullPointerException - if propertyId is null
      IllegalArgumentException - if propertyId is a placeholder ID
    • forBaseRevision

      public static PropertyUpdateBuilder forBaseRevision(PropertyDocument revision)
      Creates new builder object for constructing update of given base property entity revision. Provided property document might not represent the latest revision of the property 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.
      Parameters:
      revision - base property entity revision to be updated
      Returns:
      update builder object
      Throws:
      NullPointerException - if revision is null
      IllegalArgumentException - if revision has placeholder ID
    • updateStatements

      public PropertyUpdateBuilder updateStatements(StatementUpdate update)
      Description copied from class: StatementDocumentUpdateBuilder
      Updates entity statements. If this method is called multiple times, changes are accumulated. If base entity revision was provided, the update is checked against it and redundant changes are silently ignored, resulting in empty update.
      Overrides:
      updateStatements in class TermedDocumentUpdateBuilder
      Parameters:
      update - statement update, possibly empty
      Returns:
      this (fluent method)
    • updateLabels

      public PropertyUpdateBuilder updateLabels(TermUpdate update)
      Description copied from class: LabeledDocumentUpdateBuilder
      Updates entity labels. If this method is called multiple times, changes are accumulated. If base entity revision was provided, redundant changes are silently ignored, resulting in empty update.
      Overrides:
      updateLabels in class TermedDocumentUpdateBuilder
      Parameters:
      update - changes in entity labels
      Returns:
      this (fluent method)
    • updateDescriptions

      public PropertyUpdateBuilder updateDescriptions(TermUpdate update)
      Description copied from class: TermedDocumentUpdateBuilder
      Updates entity descriptions. If this method is called multiple times, changes are accumulated. If base entity revision was provided, redundant changes are silently ignored, resulting in empty update.
      Overrides:
      updateDescriptions in class TermedDocumentUpdateBuilder
      Parameters:
      update - changes in entity descriptions
      Returns:
      this (fluent method)
    • updateAliases

      public PropertyUpdateBuilder updateAliases(String language, AliasUpdate update)
      Description copied from class: TermedDocumentUpdateBuilder
      Updates entity aliases. If this method is called multiple times, changes are accumulated. If base entity revision was provided, the update is checked against it and redundant changes are silently ignored, resulting in empty update.
      Overrides:
      updateAliases in class TermedDocumentUpdateBuilder
      Parameters:
      language - language code of the altered aliases
      update - alias changes
      Returns:
      this (fluent method)
    • append

      public PropertyUpdateBuilder append(PropertyUpdate update)
      Replays all changes in provided update into this builder object. Changes from the update are added on top of changes already present in this builder object.
      Parameters:
      update - property update to replay
      Returns:
      this (fluent method)
      Throws:
      NullPointerException - if update is null
      IllegalArgumentException - if update cannot be applied to base entity revision (if available)
    • build

      public PropertyUpdate build()
      Description copied from class: TermedDocumentUpdateBuilder
      Creates new TermedStatementDocumentUpdate object with contents of this builder object.
      Specified by:
      build in class TermedDocumentUpdateBuilder
      Returns:
      constructed object