Package com.yahoo.vespa.indexinglanguage
Class FieldValueConverter
java.lang.Object
com.yahoo.vespa.indexinglanguage.FieldValueConverter
- Direct Known Subclasses:
StringFieldConverter
- Author:
- Simon Thoresen Hult
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal com.yahoo.document.datatypes.FieldValueconvert(com.yahoo.document.datatypes.FieldValue value) protected com.yahoo.document.datatypes.FieldValueconvertMap(com.yahoo.document.datatypes.MapFieldValue<com.yahoo.document.datatypes.FieldValue, com.yahoo.document.datatypes.FieldValue> val) protected abstract com.yahoo.document.datatypes.FieldValuedoConvert(com.yahoo.document.datatypes.FieldValue value) Converts the given value.protected abstract booleanshouldConvert(com.yahoo.document.datatypes.FieldValue value) Returns whether the givenFieldValueshould be converted.
-
Constructor Details
-
FieldValueConverter
public FieldValueConverter()
-
-
Method Details
-
convert
public final com.yahoo.document.datatypes.FieldValue convert(com.yahoo.document.datatypes.FieldValue value) -
convertMap
protected com.yahoo.document.datatypes.FieldValue convertMap(com.yahoo.document.datatypes.MapFieldValue<com.yahoo.document.datatypes.FieldValue, com.yahoo.document.datatypes.FieldValue> val) -
shouldConvert
protected abstract boolean shouldConvert(com.yahoo.document.datatypes.FieldValue value) Returns whether the givenFieldValueshould be converted. If this method returns false, the converter will proceed to traverse the value itself to see if its internal can be converted.- Parameters:
value- the value to check- Returns:
- true to convert, false to traverse
-
doConvert
protected abstract com.yahoo.document.datatypes.FieldValue doConvert(com.yahoo.document.datatypes.FieldValue value) Converts the given value. It is IMPERATIVE that the implementation of this method DOES NOT mutate the givenFieldValuein place, as that can cause SERIOUS inconsistencies in the parent structures.- Parameters:
value- the value to convert- Returns:
- the value to replace the old
-