@Immutable public interface Record
StatementResult
- results
are streams of records, where records carry the values your statement returned.
Records are made up of named, ordered fields
, each field has
a key and a value, both are determined by the statement you've executed. To
access the values in your result, you can either use the field key or the field
index, meaning the position the field has in the record.Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
Return this record as a map, where each value has been converted to a default
java object using
Value.asObject() . |
<T> Map<String,T> |
asMap(Function<Value,T> mapper)
Return this record as a map, where each value has been converted using the provided
mapping function.
|
boolean |
containsKey(String key)
Check if the list of keys contains the given key
|
boolean |
equals(Object other) |
List<Pair<String,Value>> |
fields()
Retrieve all record fields
|
Value |
get(int index)
Retrieve the value at the given field index
|
Value |
get(String key)
Retrieve the value of the property with the given key
|
int |
hashCode() |
int |
index(String key)
Retrieve the index of the field with the given key
|
List<String> |
keys()
Retrieve the keys of the underlying map
|
int |
size()
Retrieve the number of fields in this record
|
List<Value> |
values()
Retrieve the values of the underlying map
|
List<Value> values()
boolean containsKey(String key)
key
- the keyint index(String key)
key
- the give keyget(int)
NoSuchElementException
- if the given key is not from keys()
Value get(String key)
key
- the key of the propertyNullValue
if no such key existsNoSuchRecordException
- if the associated underlying record is not availableValue get(int index)
index
- the index of the valueNullValue
if the index is out of boundsClientException
- if record has not been initializedint size()
Map<String,Object> asMap()
Value.asObject()
.
This is equivalent to calling asMap(Function)
with Values.ofObject()
.<T> Map<String,T> asMap(Function<Value,T> mapper)
Values
.T
- the type to convert tomapper
- the mapping functionfor a long list of built-in conversion functions
List<Pair<String,Value>> fields()
NoSuchRecordException
- if the associated underlying record is not availableCopyright © 2016. All rights reserved.