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 FieldValue
get(int index)
Gets field value by index.FieldValue
get(String name)
Gets field value by index.boolean
hasSchema()
Returnstrue
if schema is provided,false
otherwise.static FieldValueList
of(List<FieldValue> row, Field... schema)
Creates an instance ofFieldValueList
, useful for testing.static FieldValueList
of(List<FieldValue> row, FieldList schema)
Creates an instance ofFieldValueList
, useful for testing.int
size()
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:
get
in interfaceList<FieldValue>
- Specified by:
get
in 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 ifname
was not found in the schema
-
hasSchema
public boolean hasSchema()
Returnstrue
if schema is provided,false
otherwise.
-
size
public int size()
Returns the total number of field values in the row.- Specified by:
size
in interfaceCollection<FieldValue>
- Specified by:
size
in interfaceList<FieldValue>
- Specified by:
size
in 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.
-
-