Class EntityIdValueImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.ValueImpl
org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl
- All Implemented Interfaces:
EntityIdValue
,IriIdentifiedValue
,Value
- Direct Known Subclasses:
ItemIdValueImpl
,LexemeIdValueImpl
,MediaInfoIdValueImpl
,PropertyIdValueImpl
Abstract base implementation of
EntityIdValue
for Jackson.- Author:
- Markus Kroetzsch, Fredo Erxleben, Thomas Pellissier Tanon, Antonin Delpeuch
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The string used in JSON to denote the type of entity id values that are lexemes forms.static final String
The string used in JSON to denote the type of entity id values that are items.static final String
The string used in JSON to denote the type of entity id values that are lexemes.static final String
The string used in JSON to denote the type of entity id values that are media info.static final String
The string used in JSON to denote the type of entity id values that are properties.static final String
The string used in JSON to denote the type of entity id values that are lexemes senses.Fields inherited from class org.wikidata.wdtk.datamodel.implementation.ValueImpl
JSON_VALUE_TYPE_ENTITY_ID, JSON_VALUE_TYPE_GLOBE_COORDINATES, JSON_VALUE_TYPE_MONOLINGUAL_TEXT, JSON_VALUE_TYPE_QUANTITY, JSON_VALUE_TYPE_STRING, JSON_VALUE_TYPE_TIME
Fields inherited from interface org.wikidata.wdtk.datamodel.interfaces.EntityIdValue
ET_FORM, ET_ITEM, ET_LEXEME, ET_MEDIA_INFO, ET_PROPERTY, ET_SENSE, ET_UNSUPPORTED, SITE_LOCAL
-
Constructor Summary
ModifierConstructorDescriptionprotected
EntityIdValueImpl
(String id, String siteIri) Constructor.protected
EntityIdValueImpl
(org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId value, String siteIri) Constructor used for deserialization with Jackson. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertHasJsonEntityType
(String expectedType) static EntityIdValue
Parses an item idgetId()
Returns the id of this entity.getIri()
Get the IRI of this entity.Returns an IRI that identifies the site that this entity comes from,, e.g., "http://www.wikidata.org/entity/" for Wikidata.org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId
getValue()
Returns the inner value helper object.static String
Returns the entity type of the id like "item" or "property"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.EntityIdValue
getEntityType, isPlaceholder
-
Field Details
-
JSON_ENTITY_TYPE_ITEM
The string used in JSON to denote the type of entity id values that are items.- See Also:
-
JSON_ENTITY_TYPE_PROPERTY
The string used in JSON to denote the type of entity id values that are properties.- See Also:
-
JSON_ENTITY_TYPE_LEXEME
The string used in JSON to denote the type of entity id values that are lexemes.- See Also:
-
JSON_ENTITY_TYPE_FORM
The string used in JSON to denote the type of entity id values that are lexemes forms.- See Also:
-
JSON_ENTITY_TYPE_SENSE
The string used in JSON to denote the type of entity id values that are lexemes senses.- See Also:
-
JSON_ENTITY_TYPE_MEDIA_INFO
The string used in JSON to denote the type of entity id values that are media info.- See Also:
-
-
Constructor Details
-
EntityIdValueImpl
Constructor.- Parameters:
id
- the identifier of the entity, such as "Q42"siteIri
- the siteIRI that this value refers to
-
EntityIdValueImpl
protected EntityIdValueImpl(org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId value, String siteIri) Constructor used for deserialization with Jackson.
-
-
Method Details
-
fromId
Parses an item id- Parameters:
id
- the identifier of the entity, such as "Q42"siteIri
- the siteIRI that this value refers to- Throws:
IllegalArgumentException
- if the id is invalid
-
guessEntityTypeFromId
Returns the entity type of the id like "item" or "property"- Parameters:
id
- the identifier of the entity, such as "Q42"- Throws:
IllegalArgumentException
- if the id is invalid
-
getValue
public org.wikidata.wdtk.datamodel.implementation.EntityIdValueImpl.JacksonInnerEntityId getValue()Returns the inner value helper object. Only for use by Jackson during serialization.- Returns:
- the inner entity id value
-
getIri
Description copied from interface:IriIdentifiedValue
Get the IRI of this entity.- Specified by:
getIri
in interfaceIriIdentifiedValue
- Returns:
- String with the IRI
-
getId
Description copied from interface:EntityIdValue
Returns the id of this entity.- Specified by:
getId
in interfaceEntityIdValue
- Returns:
- String id of this entity
-
getSiteIri
Description copied from interface:EntityIdValue
Returns an IRI that identifies the site that this entity comes from,, e.g., "http://www.wikidata.org/entity/" for Wikidata.- Specified by:
getSiteIri
in interfaceEntityIdValue
- Returns:
- the site IRI string
-
assertHasJsonEntityType
-