java.lang.Object
org.wikidata.wdtk.datamodel.implementation.SnakImpl
All Implemented Interfaces:
Snak
Direct Known Subclasses:
NoValueSnakImpl, SomeValueSnakImpl, ValueSnakImpl

public abstract class SnakImpl extends Object implements Snak
Abstract Jackson implementation of Snak.
Author:
Fredo Erxleben, Antonin Delpeuch
  • Field Details

    • JSON_SNAK_TYPE_VALUE

      public static final String JSON_SNAK_TYPE_VALUE
      Type string used to denote value snaks in JSON.
      See Also:
    • JSON_SNAK_TYPE_SOMEVALUE

      public static final String JSON_SNAK_TYPE_SOMEVALUE
      Type string used to denote somevalue snaks in JSON.
      See Also:
    • JSON_SNAK_TYPE_NOVALUE

      public static final String JSON_SNAK_TYPE_NOVALUE
      Type string used to denote novalue snaks in JSON.
      See Also:
  • Constructor Details

    • SnakImpl

      public SnakImpl(PropertyIdValue property)
      Constructor.
    • SnakImpl

      protected SnakImpl(String id, String siteIri)
      Constructor. Creates an empty object that can be populated during JSON deserialization. Should only be used by Jackson for this very purpose. This is not marked as JsonCreator because only concrete subclasses will be deserialized directly.
  • Method Details

    • getProperty

      public String getProperty()
      Returns the property id string. Only for use by Jackson during serialization.
      Returns:
      the property id string
    • getPropertyId

      public PropertyIdValue getPropertyId()
      Description copied from interface: Snak
      Get the id of the property that this snak refers to.
      Specified by:
      getPropertyId in interface Snak
      Returns:
      PropertyId of this Snak
    • getSnakType

      public abstract String getSnakType()