Class EntityDocumentBuilder<T extends EntityDocumentBuilder<T,O>,O extends TermedStatementDocument>

java.lang.Object
org.wikidata.wdtk.datamodel.helpers.AbstractDataObjectBuilder<T,O>
org.wikidata.wdtk.datamodel.helpers.EntityDocumentBuilder<T,O>
Type Parameters:
T - the type of the eventual concrete builder implementation
O - the type of the object that is being built
Direct Known Subclasses:
ItemDocumentBuilder, PropertyDocumentBuilder

public abstract class EntityDocumentBuilder<T extends EntityDocumentBuilder<T,O>,O extends TermedStatementDocument> extends AbstractDataObjectBuilder<T,O>
Abstract base class for builders that construct EntityDocument objects.
Author:
Markus Kroetzsch
  • Constructor Details

    • EntityDocumentBuilder

      protected EntityDocumentBuilder(EntityIdValue entityIdValue)
    • EntityDocumentBuilder

      protected EntityDocumentBuilder(O initialDocument)
      Starts constructing an EntityDocument from an initial version of this document.
      Parameters:
      initialDocument - the initial version of the document to use
  • Method Details

    • withRevisionId

      public T withRevisionId(long revisionId)
      Sets the revision id for the constructed document. See EntityDocument.getRevisionId().
      Parameters:
      revisionId - the revision id
      Returns:
      builder object to continue construction
    • withEntityId

      public T withEntityId(EntityIdValue entityId)
      Changes the entity value id for the constructed document. See EntityDocument.getEntityId().
      Parameters:
      entityId - the entity id
      Returns:
      builder object to continue construction
    • withLabel

      public T withLabel(MonolingualTextValue mtv)
      Adds an additional label to the constructed document.
      Parameters:
      mtv - the additional label
      Returns:
      builder object to continue construction
    • withLabel

      public T withLabel(String text, String languageCode)
      Adds an additional label to the constructed document.
      Parameters:
      text - the text of the label
      languageCode - the language code of the label
      Returns:
      builder object to continue construction
    • withDescription

      public T withDescription(MonolingualTextValue mtv)
      Adds an additional description to the constructed document.
      Parameters:
      mtv - the additional description
      Returns:
      builder object to continue construction
    • withDescription

      public T withDescription(String text, String languageCode)
      Adds an additional description to the constructed document.
      Parameters:
      text - the text of the description
      languageCode - the language code of the description
      Returns:
      builder object to continue construction
    • withAlias

      public T withAlias(MonolingualTextValue mtv)
      Adds an additional alias to the constructed document.
      Parameters:
      mtv - the additional alias
      Returns:
      builder object to continue construction
    • withAlias

      public T withAlias(String text, String languageCode)
      Adds an additional alias to the constructed document.
      Parameters:
      text - the text of the alias
      languageCode - the language code of the alias
      Returns:
      builder object to continue construction
    • withStatement

      public T withStatement(Statement statement)
      Adds an additional statement to the constructed document.
      Parameters:
      statement - the additional statement
      Returns:
      builder object to continue construction
    • getStatementGroups

      protected List<StatementGroup> getStatementGroups()
      Returns a list of StatementGroup objects for the currently stored statements.
      Returns: