Class DatatypeIdImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.DatatypeIdImpl
- All Implemented Interfaces:
DatatypeIdValue
Jackson implementation of
DatatypeIdValue. This is not actually
present in JSON but needed to satisfy the interface.- Author:
- Fredo Erxleben, Antonin Delpeuch
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringString used to refer to the property datatypeDatatypeIdValue.DT_COMMONS_MEDIAin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_EDTFin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_EXTERNAL_IDin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_GEO_SHAPEin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_GLOBE_COORDINATESin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_ITEMin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_MATHin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_MONOLINGUAL_TEXTin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_PROPERTYin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_QUANTITYin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_STRINGin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_TIMEin JSON.static final StringString used to refer to the property datatypeDatatypeIdValue.DT_ITEMin JSON.Fields inherited from interface org.wikidata.wdtk.datamodel.interfaces.DatatypeIdValue
DT_COMMONS_MEDIA, DT_EDTF, DT_EXTERNAL_ID, DT_FORM, DT_GEO_SHAPE, DT_GLOBE_COORDINATES, DT_ITEM, DT_LEXEME, DT_MATH, DT_MEDIA_INFO, DT_MONOLINGUAL_TEXT, DT_PROPERTY, DT_QUANTITY, DT_SENSE, DT_STRING, DT_TABULAR_DATA, DT_TIME, DT_URL -
Constructor Summary
ConstructorsConstructorDescriptionDatatypeIdImpl(String iri) Deprecated.DatatypeIdImpl(String iri, String jsonString) Constructs an object representing the datatype id from an IRI denoting the datatype, as well as a string corresponding to its JSON serialization.DatatypeIdImpl(DatatypeIdValue other) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic StringgetDatatypeIriFromJsonDatatype(String jsonDatatype) Returns the WDTK datatype IRI for the property datatype as represented by the given JSON datatype string.getIri()Get the IRI of this entity.static StringgetJsonDatatypeFromDatatypeIri(String datatypeIri) Deprecated.this method is unreliable and will be removed in a future release.Returns the string used to represent this datatype in JSON.inthashCode()toString()
-
Field Details
-
JSON_DT_ITEM
String used to refer to the property datatypeDatatypeIdValue.DT_ITEMin JSON.- See Also:
-
JSON_DT_PROPERTY
String used to refer to the property datatypeDatatypeIdValue.DT_PROPERTYin JSON.- See Also:
-
JSON_DT_GLOBE_COORDINATES
String used to refer to the property datatypeDatatypeIdValue.DT_GLOBE_COORDINATESin JSON.- See Also:
-
JSON_DT_URL
String used to refer to the property datatypeDatatypeIdValue.DT_ITEMin JSON.- See Also:
-
JSON_DT_COMMONS_MEDIA
String used to refer to the property datatypeDatatypeIdValue.DT_COMMONS_MEDIAin JSON.- See Also:
-
JSON_DT_TIME
String used to refer to the property datatypeDatatypeIdValue.DT_TIMEin JSON.- See Also:
-
JSON_DT_QUANTITY
String used to refer to the property datatypeDatatypeIdValue.DT_QUANTITYin JSON.- See Also:
-
JSON_DT_STRING
String used to refer to the property datatypeDatatypeIdValue.DT_STRINGin JSON.- See Also:
-
JSON_DT_MONOLINGUAL_TEXT
String used to refer to the property datatypeDatatypeIdValue.DT_MONOLINGUAL_TEXTin JSON.- See Also:
-
JSON_DT_EXTERNAL_ID
String used to refer to the property datatypeDatatypeIdValue.DT_EXTERNAL_IDin JSON.- See Also:
-
JSON_DT_MATH
String used to refer to the property datatypeDatatypeIdValue.DT_MATHin JSON.- See Also:
-
JSON_DT_GEO_SHAPE
String used to refer to the property datatypeDatatypeIdValue.DT_GEO_SHAPEin JSON.- See Also:
-
JSON_DT_EDTF
String used to refer to the property datatypeDatatypeIdValue.DT_EDTFin JSON.- See Also:
-
-
Constructor Details
-
DatatypeIdImpl
Copy constructor. -
DatatypeIdImpl
Deprecated.Constructs an object representing the datatype id from a IRI denoting the datatype. It also tries to determine the JSON datatype based on this IRI, based on a buggy heuristic. If you also happen to have the JSON datatype at hand, better useDatatypeIdImpl(java.lang.String,java.lang.String).- Parameters:
iri- the WDTK IRI for the datatype- Throws:
IllegalArgumentException- if the given datatype string could not be matched to a known datatype or was null
-
DatatypeIdImpl
Constructs an object representing the datatype id from an IRI denoting the datatype, as well as a string corresponding to its JSON serialization. This constructor is meant to be used for JSON deserialization.- Parameters:
iri- the WDTK IRI for the datatype. This can be null.jsonString- the JSON representation of the datatype. This cannot be null.- Throws:
IllegalArgumentException- if the given datatype string could not be matched to a known datatype or was null
-
-
Method Details
-
getDatatypeIriFromJsonDatatype
Returns the WDTK datatype IRI for the property datatype as represented by the given JSON datatype string.- Parameters:
jsonDatatype- the JSON datatype string; case-sensitive- Throws:
IllegalArgumentException- if the given datatype string is not known
-
getJsonDatatypeFromDatatypeIri
Deprecated.this method is unreliable and will be removed in a future release.Returns the JSON datatype for the property datatype as represented by the given WDTK datatype IRI string.- Parameters:
datatypeIri- the WDTK datatype IRI string; case-sensitive- Throws:
IllegalArgumentException- if the given datatype string is not known
-
getJsonString
Returns the string used to represent this datatype in JSON.- Specified by:
getJsonStringin interfaceDatatypeIdValue
-
getIri
Description copied from interface:DatatypeIdValueGet the IRI of this entity.- Specified by:
getIriin interfaceDatatypeIdValue- Returns:
- String with the IRI
-
toString
-
equals
-
hashCode
public int hashCode()
-
DatatypeIdImpl(String, String)