Class UnsupportedValueImpl

java.lang.Object
org.wikidata.wdtk.datamodel.implementation.ValueImpl
org.wikidata.wdtk.datamodel.implementation.UnsupportedValueImpl
All Implemented Interfaces:
UnsupportedValue, Value

public class UnsupportedValueImpl extends ValueImpl implements UnsupportedValue
Represents a value with an unsupported datatype. We can still "deserialize" it by just storing its JSON representation, so that it can be serialized back to its original representation. This avoids parsing failures on documents containing these values.
Author:
Antonin Delpeuch
  • Method Details

    • accept

      public <T> T accept(ValueVisitor<T> valueVisitor)
      Description copied from interface: Value
      Accept a ValueVisitor and return its output.
      Specified by:
      accept in interface Value
      Parameters:
      valueVisitor - the ValueVisitor
      Returns:
      output of the visitor
    • getTypeJsonString

      public String getTypeJsonString()
      Description copied from interface: UnsupportedValue
      Returns the type string found in the JSON representation of this value.
      Specified by:
      getTypeJsonString in interface UnsupportedValue
      Returns:
      the value of "type" in the JSON representation of this value.
    • getContents

      protected Map<String,com.fasterxml.jackson.databind.JsonNode> getContents()
    • loadContents

      protected void loadContents(String key, com.fasterxml.jackson.databind.JsonNode value)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      We do not use the Hash helper as in other datamodel classes because this would require exposing the contents of the value publicly, which goes against the desired opacity of the representation.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      We do not use the Equality helper as in other datamodel classes because this would require exposing the contents of the value publicly, which goes against the desired opacity of the representation.
      Overrides:
      equals in class Object