Class FieldPathEntry

java.lang.Object
com.yahoo.document.FieldPathEntry

public class FieldPathEntry extends Object
Author:
thomasg
  • Method Details

    • getResultingDataType

      public DataType getResultingDataType()
    • getType

      public FieldPathEntry.Type getType()
    • getFieldRef

      public Field getFieldRef()
    • getLookupIndex

      public int getLookupIndex()
    • getLookupKey

      public FieldValue getLookupKey()
    • getVariableName

      public String getVariableName()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newStructFieldEntry

      public static FieldPathEntry newStructFieldEntry(Field fieldRef)
      Creates a new field path entry that references a struct field. For these kinds of field path entries, getFieldRef() is valid.
      Parameters:
      fieldRef - The field to look up in the struct.
      Returns:
      The new field path entry
    • newArrayLookupEntry

      public static FieldPathEntry newArrayLookupEntry(int lookupIndex, DataType resultingDataType)
      Creates a new field path entry that references an array index.
      Parameters:
      lookupIndex - The index to look up
      resultingDataType - The datatype of the contents of the array
      Returns:
      The new field path entry
    • newMapLookupEntry

      public static FieldPathEntry newMapLookupEntry(FieldValue lookupKey, DataType resultingDataType)
      Creates a new field path entry that references a map or weighted set.
      Parameters:
      lookupKey - The value of the key in the map or weighted set to recurse into.
      resultingDataType - The datatype of values in the map or weighted set.
      Returns:
      The new field path entry
    • newAllKeysLookupEntry

      public static FieldPathEntry newAllKeysLookupEntry(DataType resultingDataType)
      Creates a new field path entry that digs through all the keys of a map or weighted set.
      Parameters:
      resultingDataType - The datatype of the keys in the map or weighted set.
      Returns:
      The new field path entry.
    • newAllValuesLookupEntry

      public static FieldPathEntry newAllValuesLookupEntry(DataType resultingDataType)
      Creates a new field path entry that digs through all the values of a map or weighted set.
      Parameters:
      resultingDataType - The datatype of the values in the map or weighted set.
      Returns:
      The new field path entry.
    • newVariableLookupEntry

      public static FieldPathEntry newVariableLookupEntry(String variableName, DataType resultingDataType)
      Creates a new field path entry that digs through all the keys in a map or weighted set, or all the indexes of an array, an sets the given variable name as it does so (or, if the variable is set, uses the set variable to look up the collection.
      Parameters:
      variableName - The name of the variable to lookup in the collection
      resultingDataType - The value type of the collection we're digging through
      Returns:
      The new field path entry.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public static FieldPathEntry.KeyParseResult parseKey(String key)
      Parse a field path map key of the form {xyz} or {"xyz"} with optional trailing data. If the key contains a '}' or '"' character, the key must be in quotes and all double-quote characters must be escaped. Only '"' chars may be escaped. Any trailing string data past the '}' is ignored.
      Parameters:
      key - Part of a field path that contains a key at its start
      Returns:
      A parse result containing the parsed/unescaped key and the number of input characters the parse consumed. Does not include any characters beyond the '}' char.