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 Summary
Modifier and TypeMethodDescriptionvisit
(EntityIdValue value) Visits a EntityIdValue and returns a result.visit
(GlobeCoordinatesValue value) Visits a GlobeCoordinatesValue and returns a result.visit
(MonolingualTextValue value) Visits a MonolingualTextValue and returns a result.visit
(QuantityValue value) Visits a QuantityValue and returns a result.visit
(StringValue value) Visits a StringValue and returns a result.Visits a TimeValue and returns a result.visit
(UnsupportedValue value) Visits an UnsupportedValue and returns a result
-
Method Details
-
visit
Visits a EntityIdValue and returns a result. In practice, only specific subtypes of EntityIdValue are used, such asItemIdValue
andPropertyIdValue
. 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
Visits a GlobeCoordinatesValue and returns a result.- Parameters:
value
- the value to visit- Returns:
- the result for this value
-
visit
Visits a MonolingualTextValue and returns a result.- Parameters:
value
- the value to visit- Returns:
- the result for this value
-
visit
Visits a QuantityValue and returns a result.- Parameters:
value
- the value to visit- Returns:
- the result for this value
-
visit
Visits a StringValue and returns a result.- Parameters:
value
- the value to visit- Returns:
- the result for this value
-
visit
Visits a TimeValue and returns a result.- Parameters:
value
- the value to visit- Returns:
- the result for this value
-
visit
Visits an UnsupportedValue and returns a result- Parameters:
value
- the value to visit- Returns:
- the result for this value
-