Class FieldValueConverter

java.lang.Object
com.yahoo.vespa.indexinglanguage.FieldValueConverter
Direct Known Subclasses:
StringFieldConverter

public abstract class FieldValueConverter extends Object
Author:
Simon Thoresen Hult
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final com.yahoo.document.datatypes.FieldValue
    convert(com.yahoo.document.datatypes.FieldValue value)
     
    protected com.yahoo.document.datatypes.FieldValue
    convertMap(com.yahoo.document.datatypes.MapFieldValue<com.yahoo.document.datatypes.FieldValue,com.yahoo.document.datatypes.FieldValue> val)
     
    protected abstract com.yahoo.document.datatypes.FieldValue
    doConvert(com.yahoo.document.datatypes.FieldValue value)
    Converts the given value.
    protected abstract boolean
    shouldConvert(com.yahoo.document.datatypes.FieldValue value)
    Returns whether the given FieldValue should be converted.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 given FieldValue should 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 given FieldValue in place, as that can cause SERIOUS inconsistencies in the parent structures.
      Parameters:
      value - the value to convert
      Returns:
      the value to replace the old