Package com.google.cloud.bigquery
Class FieldValueList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<FieldValue>
-
- com.google.cloud.bigquery.FieldValueList
-
- All Implemented Interfaces:
Serializable,Iterable<FieldValue>,Collection<FieldValue>,List<FieldValue>
public class FieldValueList extends AbstractList<FieldValue> implements Serializable
Google BigQuery Table Field Values class, which represents a row in returned query result (table row). Tables rows can be retrieved as a result of a query or when listing table data.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.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldValueget(int index)Gets field value by index.FieldValueget(String name)Gets field value by index.booleanhasSchema()Returnstrueif schema is provided,falseotherwise.static FieldValueListof(List<FieldValue> row, Field... schema)Creates an instance ofFieldValueList, useful for testing.static FieldValueListof(List<FieldValue> row, FieldList schema)Creates an instance ofFieldValueList, useful for testing.intsize()Returns the total number of field values in the row.-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
get
public FieldValue get(int index)
Gets field value by index.- Specified by:
getin interfaceList<FieldValue>- Specified by:
getin classAbstractList<FieldValue>- Parameters:
index- field value index
-
get
public FieldValue get(String name)
Gets field value by index.- Parameters:
name- field name (defined in schema)- Throws:
IllegalArgumentException- if schema is not provided or ifnamewas not found in the schema
-
hasSchema
public boolean hasSchema()
Returnstrueif schema is provided,falseotherwise.
-
size
public int size()
Returns the total number of field values in the row.- Specified by:
sizein interfaceCollection<FieldValue>- Specified by:
sizein interfaceList<FieldValue>- Specified by:
sizein classAbstractCollection<FieldValue>
-
of
@BetaApi public static FieldValueList of(List<FieldValue> row, FieldList schema)
Creates an instance ofFieldValueList, useful for testing.This method is unstable. See this discussion for more context.
-
of
@BetaApi public static FieldValueList of(List<FieldValue> row, Field... schema)
Creates an instance ofFieldValueList, useful for testing.This method is unstable. See this discussion for more context.
-
-