Interface ValueVisitor<T>

Type Parameters:
T - the return type of the visitor
All Known Implementing Classes:
AnyValueConverter, DatamodelConverter

public interface ValueVisitor<T>
A visitor for the various types of values in the datamodel. This should be used to avoid any type casting or instanceof checks when processing values.

The visitor does not distinguish several types of EntityIdValue, since these are supposed to be extensible and therefore cannot be fixed in a visitor interface.

Author:
Markus Kroetzsch
  • Method Details

    • visit

      T visit(EntityIdValue value)
      Visits a EntityIdValue and returns a result. In practice, only specific subtypes of EntityIdValue are used, such as ItemIdValue and PropertyIdValue. Since the set of possible subtypes can be extended by extensions of Wikibase, the visitor only visits the general (abstract) supertype. Implementations will have to decide if the given specific type is supported and what to do with it.
      Parameters:
      value - the value to visit
      Returns:
      the result for this value
    • visit

      T visit(GlobeCoordinatesValue value)
      Visits a GlobeCoordinatesValue and returns a result.
      Parameters:
      value - the value to visit
      Returns:
      the result for this value
    • visit

      T visit(MonolingualTextValue value)
      Visits a MonolingualTextValue and returns a result.
      Parameters:
      value - the value to visit
      Returns:
      the result for this value
    • visit

      T visit(QuantityValue value)
      Visits a QuantityValue and returns a result.
      Parameters:
      value - the value to visit
      Returns:
      the result for this value
    • visit

      T visit(StringValue value)
      Visits a StringValue and returns a result.
      Parameters:
      value - the value to visit
      Returns:
      the result for this value
    • visit

      T visit(TimeValue value)
      Visits a TimeValue and returns a result.
      Parameters:
      value - the value to visit
      Returns:
      the result for this value
    • visit

      T visit(UnsupportedValue value)
      Visits an UnsupportedValue and returns a result
      Parameters:
      value - the value to visit
      Returns:
      the result for this value