Package com.graphdbapi.driver.v1
Interface Record
-
- All Superinterfaces:
MapAccessorWithDefaultValue
public interface Record extends MapAccessorWithDefaultValue
结果值的容器记录流从Cypher语句执行返回,包含在
StatementResult
内。- Author:
- lvfulin
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Object>
asMap()
将此记录作为map返回,其中每个值都已使用Value.asObject()
被转换为默认java对象<T> Map<String,T>
asMap(com.graphdbapi.driver.v1.util.Function<Value,T> mapper)
将此记录作为map返回,其中值使用给定的转换函数进行转换。您可以在Values
中找到一个公共映射函数库。boolean
containsKey(String key)
检查键列表是否包含给定键List<com.graphdbapi.driver.v1.util.Pair<String,Value>>
fields()
检索所有记录字段Value
get(int index)
检索给定字段索引处的值Value
get(String key)
使用给定键检索属性的值int
index(String key)
使用给定键检索字段的索引List<String>
keys()
检索基础映射的键int
size()
检索此记录中的字段数List<Value>
values()
检索基础映射的值
-
-
-
Method Detail
-
containsKey
boolean containsKey(String key)
检查键列表是否包含给定键- Parameters:
key
- 键- Returns:
- true 如果包含了给定键,否则 false
-
index
int index(String key)
使用给定键检索字段的索引- Parameters:
key
- 给定的键- Returns:
get(int)
使用的字段的索引- Throws:
NoSuchElementException
- 如果给定的键不在keys()
-
get
Value get(String key)
使用给定键检索属性的值- Parameters:
key
- 属性的键- Returns:
- 属性值或
NullValue
如果键不存在 - Throws:
com.graphdbapi.driver.v1.exceptions.NoSuchRecordException
- 如果关联的底层记录不可用
-
get
Value get(int index)
检索给定字段索引处的值- Parameters:
index
- 值的索引- Returns:
- 值或
NullValue
如果索引超出了范围 - Throws:
ClientException
- 如果记录尚未初始化
-
size
int size()
检索此记录中的字段数- Returns:
- 此记录中的字段数
-
asMap
Map<String,Object> asMap()
将此记录作为map返回,其中每个值都已使用Value.asObject()
被转换为默认java对象这相当于使用
Values.ofObject()
调用asMap(Function)
。- Returns:
- 记录作为map
-
asMap
<T> Map<String,T> asMap(com.graphdbapi.driver.v1.util.Function<Value,T> mapper)
将此记录作为map返回,其中值使用给定的转换函数进行转换。您可以在Values
中找到一个公共映射函数库。- Type Parameters:
T
- 要转换为的类型- Parameters:
mapper
- 映射函数- Returns:
- 记录作为map
- See Also:
有一长串内置转换函数
-
-