Class EntityDocumentImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.EntityDocumentImpl
- All Implemented Interfaces:
EntityDocument
- Direct Known Subclasses:
FormDocumentImpl
,LexemeDocumentImpl
,MediaInfoDocumentImpl
,SenseDocumentImpl
,TermedStatementDocumentImpl
Abstract Jackson implementation of
EntityDocument
. Like all Jackson
objects, it is not technically immutable, but it is strongly recommended to
treat it as such in all contexts: the setters are for Jackson; never call
them in your code.- Author:
- Thomas Pellissier Tanon
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the string id of the entity that this document refers to.long
Returns the revision ID of this document, or 0 if no id is known.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityDocument
getEntityId, withRevisionId
-
Field Details
-
entityId
The id of the entity that the document refers to. This is not mapped to JSON directly by Jackson but split into two fields, "type" and "id". The type field is ignored during deserialization since the type is clear for a concrete document. For serialization, the type is hard-coded.The site IRI, which would also be required to create a complete
EntityIdValue
, is not encoded in JSON. It needs to be injected from the outside (if not, we default to Wikidata). -
siteIri
The site IRI that this document refers to, or null if not specified. In the latter case, we assume Wikidata as the default.- See Also:
-
revisionId
protected final long revisionIdThe revision id of this document.- See Also:
-
-
Method Details
-
getJsonId
Returns the string id of the entity that this document refers to. Only for use by Jackson during serialization.- Returns:
- string id
-
getSiteIri
-
getRevisionId
public long getRevisionId()Description copied from interface:EntityDocument
Returns the revision ID of this document, or 0 if no id is known. The revision ID is a number stored by MediaWiki to indicate the version of a document. It is based on a global counter that is incremented on each edit. Not all sources of entity document data may provide the revision ID, as it is not strictly part of the data, but part of the document metadata.- Specified by:
getRevisionId
in interfaceEntityDocument
- Returns:
- revision id
-