Package com.yahoo.document
Class FieldPath
java.lang.Object
com.yahoo.document.FieldPath
- All Implemented Interfaces:
Iterable<FieldPathEntry>
This class represents a path into a document, that can be used to iterate through the document and extract the field
values you're interested in.
- Author:
- Thomas Gundersen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(int index) getList()
int
hashCode()
boolean
isEmpty()
iterator()
static FieldPath
newInstance
(DataType fieldType, String fieldPath) Convenience method to build a field path from a path string.int
size()
boolean
startsWith
(FieldPath other) Compares this field path with the given field path, returns true if the field path starts with the other.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
FieldPath
public FieldPath()Constructs an empty path. -
FieldPath
Constructs a path containing the entries of the specified path, in the order they are returned by that path's iterator.- Parameters:
path
- The path whose entries are to be placed into this path.- Throws:
NullPointerException
- If the specified path is null.
-
FieldPath
-
-
Method Details
-
size
public int size() -
get
-
isEmpty
public boolean isEmpty() -
iterator
- Specified by:
iterator
in interfaceIterable<FieldPathEntry>
-
getList
-
startsWith
Compares this field path with the given field path, returns true if the field path starts with the other.- Parameters:
other
- The field path to compare with.- Returns:
- Returns true if this field path starts with the other field path, otherwise false
-
getResultingDataType
- Returns:
- Returns the datatype we can expect this field path to return.
-
newInstance
Convenience method to build a field path from a path string. This is a simple proxy forDataType.buildFieldPath(String)
.- Parameters:
fieldType
- The data type of the value to build a path for.fieldPath
- The path string to parse.- Returns:
- The corresponding field path object.
-
equals
-
hashCode
public int hashCode() -
toString
-