Package com.yahoo.document
Class FieldPathEntry
java.lang.Object
com.yahoo.document.FieldPathEntry
- Author:
- thomasg
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getType()
int
hashCode()
static FieldPathEntry
newAllKeysLookupEntry
(DataType resultingDataType) Creates a new field path entry that digs through all the keys of a map or weighted set.static FieldPathEntry
newAllValuesLookupEntry
(DataType resultingDataType) Creates a new field path entry that digs through all the values of a map or weighted set.static FieldPathEntry
newArrayLookupEntry
(int lookupIndex, DataType resultingDataType) Creates a new field path entry that references an array index.static FieldPathEntry
newMapLookupEntry
(FieldValue lookupKey, DataType resultingDataType) Creates a new field path entry that references a map or weighted set.static FieldPathEntry
newStructFieldEntry
(Field fieldRef) Creates a new field path entry that references a struct field.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.Parse a field path map key of the form {xyz} or {"xyz"} with optional trailing data.toString()
-
Method Details
-
getResultingDataType
-
getType
-
getFieldRef
-
getLookupIndex
public int getLookupIndex() -
getLookupKey
-
getVariableName
-
toString
-
newStructFieldEntry
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
Creates a new field path entry that references an array index.- Parameters:
lookupIndex
- The index to look upresultingDataType
- The datatype of the contents of the array- Returns:
- The new field path entry
-
newMapLookupEntry
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
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
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 collectionresultingDataType
- The value type of the collection we're digging through- Returns:
- The new field path entry.
-
equals
-
hashCode
public int hashCode() -
parseKey
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.
-