Interface TermedDocument

All Superinterfaces:
EntityDocument, LabeledDocument
All Known Subinterfaces:
ItemDocument, PropertyDocument, TermedStatementDocument
All Known Implementing Classes:
ItemDocumentImpl, PropertyDocumentImpl, TermedStatementDocumentImpl

public interface TermedDocument extends LabeledDocument
Interface for EntityDocuments that can be described by terms in several languages. These terms consist labels, descriptions, and aliases.
Author:
Markus Kroetzsch
  • Method Details

    • getDescriptions

      Map<String,MonolingualTextValue> getDescriptions()
      Return a Map from Wikibase language codes to descriptions.
      Returns:
      the map of descriptions
    • getAliases

      Return a Map from Wikibase language codes to lists of alias labels for a given language.
      Returns:
      the aliases for this language
    • findDescription

      default String findDescription(String languageCode)
      Returns the string description for the given language code, or null if there is no description for this code. This is a convenience method for accessing the data that can be obtained via getDescriptions().
      Parameters:
      languageCode - a string that represents language
      Returns:
      the description string or null if it does not exists
    • withRevisionId

      TermedDocument withRevisionId(long newRevisionId)
      Returns a copy of this document with an updated revision id.
      Specified by:
      withRevisionId in interface EntityDocument
      Specified by:
      withRevisionId in interface LabeledDocument
    • withLabel

      TermedDocument withLabel(MonolingualTextValue newLabel)
      Returns a new version of this document with a new label (which overrides any existing label for this language).
      Specified by:
      withLabel in interface LabeledDocument
    • withDescription

      TermedDocument withDescription(MonolingualTextValue newDescription)
      Returns a new version of this document with a new description (which overrides any existing description).
    • withAliases

      TermedDocument withAliases(String language, List<MonolingualTextValue> aliases)
      Returns a new version of this document with a new list of aliases for the given language code. Any existing aliases for this language will be discarded.
      Parameters:
      language - the language code for which the aliases should be set
      aliases - the aliases to set for this language. The language codes they contain should all match the supplied language.