Class MonolingualTextValueImpl

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

public class MonolingualTextValueImpl extends ValueImpl implements MonolingualTextValue
Jackson implementation of MonolingualTextValue. Java attributes are named equally to the JSON fields. Deviations are due to different naming in the implemented interfaces. The "value" in this JSON context is called "text".

The class extends ValueImpl which adds a type association done by the JSON.

Author:
Fredo Erxleben, Antonin Delpeuch
  • Constructor Details

    • MonolingualTextValueImpl

      public MonolingualTextValueImpl(String text, String language)
      Constructor.
  • Method Details

    • getValue

      public org.wikidata.wdtk.datamodel.implementation.MonolingualTextValueImpl.JacksonInnerMonolingualText getValue()
      Returns the inner value helper object. Only for use by Jackson during serialization.
      Returns:
      the inner monolingual text value
    • getText

      public String getText()
      Description copied from interface: MonolingualTextValue
      Get the text of this value.
      Specified by:
      getText in interface MonolingualTextValue
      Returns:
      a string
    • getLanguageCode

      public String getLanguageCode()
      Description copied from interface: MonolingualTextValue
      Get the language code of this value. The codes are usually based on the codes used internally in Wikibase, which in turn are the codes used in the Universal Language Selector extension. However, the data model as such does not restrict the strings that might be used here.
      Specified by:
      getLanguageCode in interface MonolingualTextValue
      Returns:
      a string that represents language
    • 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
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object