Class ReferenceImpl
java.lang.Object
org.wikidata.wdtk.datamodel.implementation.ReferenceImpl
- All Implemented Interfaces:
Reference
Jackson implementation of
Reference
.- Author:
- Fredo Erxleben, Markus Kroetzsch, Antonin Delpeuch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns an interator over all snaks, without considering snak groups.getHash()
Wikibase calculates a hash for each reference based on the content of the reference.Returns the list of property ids used to order snaks as found in JSON.Get the list of snak groups associated with this reference.getSnaks()
Returns the map of snaks as found in JSON.int
hashCode()
toString()
-
Constructor Details
-
ReferenceImpl
Constructor.The order of the snaks groups provided will be respected. the properties used by the snak groups should be distinct.
- Parameters:
groups
- the snaks group which form the reference
-
ReferenceImpl
Constructor for deserialization from JSON.
-
-
Method Details
-
getSnakGroups
Description copied from interface:Reference
Get the list of snak groups associated with this reference. Objects of this class are immutable, and the list should therefore not be modifiable.- Specified by:
getSnakGroups
in interfaceReference
- Returns:
- list of SnakGroups
-
getSnaks
Returns the map of snaks as found in JSON. Only for use by Jackson during serialization.- Returns:
- the map of snaks
-
getHash
Description copied from interface:Reference
Wikibase calculates a hash for each reference based on the content of the reference. This hash appears in the RDF serialization of the reference. Since the calculation is hard to reproduce, this is only available if the reference was read from a dump that contains the hash. -
getPropertyOrder
Returns the list of property ids used to order snaks as found in JSON. Only for use by Jackson during serialization.- Returns:
- the list of property ids
-
getAllSnaks
Description copied from interface:Reference
Returns an interator over all snaks, without considering snak groups. The relative order of snaks is preserved.- Specified by:
getAllSnaks
in interfaceReference
- Returns:
- iterator of snaks
-
hashCode
public int hashCode() -
equals
-
toString
-