Interface LabeledDocument
- All Superinterfaces:
EntityDocument
- All Known Subinterfaces:
ItemDocument
,LabeledStatementDocument
,MediaInfoDocument
,PropertyDocument
,TermedDocument
,TermedStatementDocument
- All Known Implementing Classes:
ItemDocumentImpl
,MediaInfoDocumentImpl
,PropertyDocumentImpl
,TermedStatementDocumentImpl
Interface for EntityDocuments that can be described by labels
in several languages.
- Author:
- Thomas Pellissier Tanon
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Returns the string label for the given language code, or null if there is no label for this code.Return a Map from Wikibase language codes to labels.withLabel
(MonolingualTextValue newLabel) Returns a new version of this document with a new label (which overrides any existing label for this language).withRevisionId
(long newRevisionId) Returns a copy of this document with an updated revision id.Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityDocument
getEntityId, getRevisionId
-
Method Details
-
getLabels
Map<String,MonolingualTextValue> getLabels()Return a Map from Wikibase language codes to labels.- Returns:
- the map of labels
-
findLabel
Returns the string label for the given language code, or null if there is no label for this code. This is a convenience method for accessing the data that can be obtained viagetLabels()
.- Parameters:
languageCode
- a string that represents language- Returns:
- the label string or null if it does not exists
-
withRevisionId
Returns a copy of this document with an updated revision id.- Specified by:
withRevisionId
in interfaceEntityDocument
-
withLabel
Returns a new version of this document with a new label (which overrides any existing label for this language).
-