public class FieldValueList extends AbstractList<FieldValue> implements Serializable
Depending on how a corresponding query was executed, each row (an instance of FieldValueList
) may or may not contain related schema. If schema is not provided, the individual
cells of the row will still be accessible by index but not by name.
modCount
Modifier and Type | Method and Description |
---|---|
FieldValue |
get(int index)
Gets field value by index.
|
FieldValue |
get(String name)
Gets field value by index.
|
boolean |
hasSchema()
Returns
true if schema is provided, false otherwise. |
static FieldValueList |
of(List<FieldValue> row,
Field... schema)
Creates an instance of
FieldValueList , useful for testing. |
static FieldValueList |
of(List<FieldValue> row,
FieldList schema)
Creates an instance of
FieldValueList , useful for testing. |
int |
size()
Returns the total number of field values in the row.
|
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public FieldValue get(int index)
get
in interface List<FieldValue>
get
in class AbstractList<FieldValue>
index
- field value indexpublic FieldValue get(String name)
name
- field name (defined in schema)IllegalArgumentException
- if schema is not provided or if name
was not found in
the schemapublic boolean hasSchema()
true
if schema is provided, false
otherwise.public int size()
size
in interface Collection<FieldValue>
size
in interface List<FieldValue>
size
in class AbstractCollection<FieldValue>
@BetaApi public static FieldValueList of(List<FieldValue> row, FieldList schema)
FieldValueList
, useful for testing.
This method is unstable. See this discussion for more context.
@BetaApi public static FieldValueList of(List<FieldValue> row, Field... schema)
FieldValueList
, useful for testing.
This method is unstable. See this discussion for more context.
Copyright © 2023 Google LLC. All rights reserved.