Interface Value

  • All Superinterfaces:
    MapAccessor, MapAccessorWithDefaultValue

    public interface Value
    extends MapAccessor, MapAccessorWithDefaultValue
    符合GraphDb类型系统的数据单元。

    这个接口描述了很多 isType方法以及 typeValue 方法。 第一组与GraphDb 类型系统中的类型相关,用于确定表示哪种GraphDb类型。 第二组方法对Java类型强制执行(尽可能)。

    Author:
    lvfulin
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      BigDecimal asBigDecimal()
      如果可能,将值作为BigDecimal
      boolean asBoolean()
      如果可能,将值作为Java布尔值。
      boolean asBoolean​(boolean defaultValue)
      如果可能,将值作为Java布尔值。
      byte asByte()
      如果转换中没有精度丢失,则返回Java byte。
      byte asByte​(byte defaultValue)
      如果转换中没有精度丢失,则返回Java byte。
      byte[] asByteArray()
      如果可能,将值作为Java字节数组。
      byte[] asByteArray​(byte[] defaultValue)
      如果可能,将值作为Java字节数组。 如果原始值为NullValue,则默认值
      char asChar()
      如果可能,将值作为Java char
      char asChar​(char defaultValue)
      如果可能,将值作为Java char
      double asDouble()
      如果转换中没有精度丢失,则返回Java double。
      double asDouble​(double defaultValue)
      如果转换中没有精度丢失,则返回Java double。
      Edge asEdge​(Graph graph)
      如果可能的话,将值作为 Edge
      com.graphdbapi.driver.v1.types.Entity asEntity()
      如果可能的话,将值作为 Entity
      float asFloat()
      如果转换中没有精度丢失,则返回Java float。
      float asFloat​(float defaultValue)
      如果转换中没有精度丢失,则返回Java float。
      int asInt()
      如果转换中没有精度丢失,则返回Java int。
      int asInt​(int defaultValue)
      如果转换中没有精度丢失,则返回Java int。
      com.graphdbapi.driver.v1.types.IsoDuration asIsoDuration()
      如果可能的话,将值作为 IsoDuration
      com.graphdbapi.driver.v1.types.IsoDuration asIsoDuration​(com.graphdbapi.driver.v1.types.IsoDuration defaultValue)
      如果可能的话,将值作为 IsoDuration
      List<Object> asList()
      如果可以将底层基础类型视为列表,则返回一个java值列表,其中每个值都已使用asObject()进行转换。
      <T> List<T> asList​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction)
      如果可能的话,将值作为通过列表元素映射获得的T列表。
      <T> List<T> asList​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction, List<T> defaultValue)
      如果可能的话,将值作为通过列表元素映射获得的T列表。
      List<Object> asList​(List<Object> defaultValue)
      如果可以将底层基础类型视为列表,则返回一个java值列表,其中每个值都已使用asObject()进行转换。
      LocalDate asLocalDate()
      如果可能的话,将值作为 Path
      LocalDate asLocalDate​(LocalDate defaultValue)
      如果可能的话,将值作为 LocalDate
      LocalDateTime asLocalDateTime()
      如果可能的话,将值作为 LocalDateTime
      LocalDateTime asLocalDateTime​(LocalDateTime defaultValue)
      如果可能的话,将值作为 LocalDateTime
      LocalTime asLocalTime()
      如果可能的话,将值作为 LocalTime
      LocalTime asLocalTime​(LocalTime defaultValue)
      如果可能的话,将值作为 LocalTime
      long asLong()
      如果转换中没有精度丢失,则返回Java long。
      long asLong​(long defaultValue)
      如果转换中没有精度丢失,则返回Java long。
      <T> Map<String,​T> asMap​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction, Map<String,​T> defaultValue)
      返回为字符串键和使用asObject()转换后的值的映射。
      Map<String,​Object> asMap​(Map<String,​Object> defaultValue)
      返回为字符串键和使用asObject()转换后的值的映射。
      com.graphdbapi.driver.v1.types.Node asNode()
      如果可能的话,将值作为 Node
      Number asNumber()
      如果可能,将值作为Java数值。
      Object asObject()
      这将返回基础值的java标准库表示,使用给定基础类型“敏感”的java类型。
      OffsetTime asOffsetTime()
      如果可能的话,将值作为 OffsetTime
      OffsetTime asOffsetTime​(OffsetTime defaultValue)
      如果可能的话,将值作为 OffsetTime
      com.graphdbapi.driver.v1.types.Path asPath()
      如果可能的话,将值作为 Path
      com.graphdbapi.driver.v1.types.Point asPoint()
      如果可能的话,将值作为 Point
      com.graphdbapi.driver.v1.types.Point asPoint​(com.graphdbapi.driver.v1.types.Point defaultValue)
      如果可能的话,将值作为 Point
      com.graphdbapi.driver.v1.types.Relationship asRelationship()
      如果可能的话,将值作为 Relationship
      Set<Object> asSet()
      如果可以将底层基础类型视为集合,则返回一个java值集合,其中每个值都已使用asObject()进行转换。
      <T> Set<T> asSet​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction)
      如果可能的话,将值作为通过集合元素映射获得的T集合。
      <T> Set<T> asSet​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction, Set<T> defaultValue)
      如果可能的话,将值作为通过集合元素映射获得的T集合。
      Set<Object> asSet​(Set<Object> defaultValue)
      如果可以将底层基础类型视为集合,则返回一个java值集合,其中每个值都已使用asObject()进行转换。
      short asShort()
      如果转换中没有精度丢失,则返回Java short。
      short asShort​(short defaultValue)
      如果转换中没有精度丢失,则返回Java short。
      String asString()
      如果可能,将值作为Java字符串。
      String asString​(String defaultValue)
      如果可能,将值作为Java字符串。
      Vertex asVertex()
      如果可能的话,将值作为 Vertex
      ZonedDateTime asZonedDateTime()
      如果可能的话,将值作为 ZonedDateTime
      ZonedDateTime asZonedDateTime​(ZonedDateTime defaultValue)
      如果可能的话,将值作为 ZonedDateTime
      <T> T computeOrDefault​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapper, T defaultValue)
      如果值不是NullValue,则对值应用映射函数;如果值为NullValue,则应用默认值。
      boolean equals​(Object other)
      Value get​(int index)
      ListValue指定索引的值
      int hashCode()
      boolean hasType​(com.graphdbapi.driver.v1.types.Type type)
      测试此值是否为给定类型的值
      boolean isEmpty()
      如果此值表示列表或映射,请测试集合是否为空。
      boolean isFalse()
      是否为BooleanValue.FALSE
      boolean isNull()
      是否为NullValue
      boolean isTrue()
      是否为BooleanValue.TRUE
      Iterable<String> keys()
      如果底层值支持 基于键的索引, 则返回映射中的一个可迭代的键, 这适用于 映射, 节点TypeSystem.RELATIONSHIP() 关系}。
      int size()
      如果底层基础值是集合类型,则返回集合中的值的数量。
      String toString()
      com.graphdbapi.driver.v1.types.Type type()
      GraphDb类型系统中定义的此值的类型
    • Method Detail

      • size

        int size()
        如果底层基础值是集合类型,则返回集合中的值的数量。

        TypeSystem.LIST() 列表},将返回列表的大小。

        映射,将返回映射中的条目数。

        TypeSystem.RELATIONSHIP() 边}, 将将返回属性的数量。

        For path values, this returns the length (number of relationships) in the path.

        Specified by:
        size in interface MapAccessor
        Returns:
        底层集合中的值的数量
      • isEmpty

        boolean isEmpty()
        如果此值表示列表或映射,请测试集合是否为空。
        Returns:
        true 大小为0,否则false
      • get

        Value get​(int index)
        ListValue指定索引的值
        Parameters:
        index - 值的索引
        Returns:
        值或 NullValue如果索引超出范围。
        Throws:
        ClientException - 如果记录尚未初始化。
      • type

        com.graphdbapi.driver.v1.types.Type type()
        GraphDb类型系统中定义的此值的类型
        Returns:
        GraphDb类型系统中定义的此值的类型
      • hasType

        boolean hasType​(com.graphdbapi.driver.v1.types.Type type)
        测试此值是否为给定类型的值
        Parameters:
        type - 给定的类型
        Returns:
        type.isTypeOf(this)
      • isTrue

        boolean isTrue()
        是否为BooleanValue.TRUE
        Returns:
        true 如果值是布尔值并且值为True。
      • isFalse

        boolean isFalse()
        是否为BooleanValue.FALSE
        Returns:
        true 如果值是布尔值并且值为False。
      • isNull

        boolean isNull()
        是否为NullValue
        Returns:
        true如果值是Null,否则 false
      • asObject

        Object asObject()
        这将返回基础值的java标准库表示,使用给定基础类型“敏感”的java类型。
        Returns:
        作为Java对象的值
      • computeOrDefault

        <T> T computeOrDefault​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapper,
                               T defaultValue)
        如果值不是NullValue,则对值应用映射函数;如果值为NullValue,则应用默认值。
        Type Parameters:
        T - 返回类型
        Parameters:
        mapper - 映射函数定义了如何将Value映射到T.
        defaultValue - 如果值为NullValue则返回的值
        Returns:
        应用给定映射函数后的值,如果值为NullValue,则为默认值。
      • asBoolean

        boolean asBoolean()
        如果可能,将值作为Java布尔值。
        Returns:
        如果可能,将值作为Java布尔值。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asBoolean

        boolean asBoolean​(boolean defaultValue)
        如果可能,将值作为Java布尔值。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此值。
        Returns:
        如果可能,将值作为Java布尔值。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asByteArray

        byte[] asByteArray()
        如果可能,将值作为Java字节数组。
        Returns:
        如果可能,将值作为Java字节数组。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asByteArray

        byte[] asByteArray​(byte[] defaultValue)
        如果可能,将值作为Java字节数组。 如果原始值为NullValue,则默认值
        Parameters:
        defaultValue - 如果原始值为NullValue,则默认为此值
        Returns:
        如果可能,将值作为Java字节数组。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asString

        String asString()
        如果可能,将值作为Java字符串。
        Returns:
        如果可能,将值作为Java字符串。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asBigDecimal

        BigDecimal asBigDecimal()
        如果可能,将值作为BigDecimal
        Returns:
        如果可能,将值作为BigDecimal
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asString

        String asString​(String defaultValue)
        如果可能,将值作为Java字符串。
        Parameters:
        defaultValue - 如果值为null,则返回此值。
        Returns:
        如果可能,将值作为Java字符串。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asChar

        char asChar()
        如果可能,将值作为Java char
        Returns:
        如果可能,将值作为Java char。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asChar

        char asChar​(char defaultValue)
        如果可能,将值作为Java char
        Parameters:
        defaultValue - 如果值为null,则返回此值。
        Returns:
        如果可能,将值作为Java char。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asNumber

        Number asNumber()
        如果可能,将值作为Java数值。
        Returns:
        如果可能,将值作为Java数值。
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLong

        long asLong()
        如果转换中没有精度丢失,则返回Java long。
        Returns:
        值作为Java long
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLong

        long asLong​(long defaultValue)
        如果转换中没有精度丢失,则返回Java long。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此默认值。
        Returns:
        值作为Java long
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asInt

        int asInt()
        如果转换中没有精度丢失,则返回Java int。
        Returns:
        值作为Java int
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asInt

        int asInt​(int defaultValue)
        如果转换中没有精度丢失,则返回Java int。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此默认值。
        Returns:
        值作为Java int
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asShort

        short asShort()
        如果转换中没有精度丢失,则返回Java short。
        Returns:
        值作为Java short
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asShort

        short asShort​(short defaultValue)
        如果转换中没有精度丢失,则返回Java short。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此默认值。
        Returns:
        值作为Java short
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asByte

        byte asByte()
        如果转换中没有精度丢失,则返回Java byte。
        Returns:
        值作为Java byte
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asByte

        byte asByte​(byte defaultValue)
        如果转换中没有精度丢失,则返回Java byte。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此默认值。
        Returns:
        值作为Java byte
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asDouble

        double asDouble()
        如果转换中没有精度丢失,则返回Java double。
        Returns:
        值作为Java double
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asDouble

        double asDouble​(double defaultValue)
        如果转换中没有精度丢失,则返回Java double。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此默认值。
        Returns:
        值作为Java double
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asFloat

        float asFloat()
        如果转换中没有精度丢失,则返回Java float。
        Returns:
        值作为Java float
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asFloat

        float asFloat​(float defaultValue)
        如果转换中没有精度丢失,则返回Java float。
        Parameters:
        defaultValue - 如果值为NullValue,则返回此默认值。
        Returns:
        值作为Java float
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.LossyCoercion - 如果无法转换值而不会丢失精度。
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asList

        List<Object> asList()
        如果可以将底层基础类型视为列表,则返回一个java值列表,其中每个值都已使用asObject()进行转换。
        Returns:
        如果可能,将值作为Java值列表
        See Also:
        asObject()
      • asList

        List<Object> asList​(List<Object> defaultValue)
        如果可以将底层基础类型视为列表,则返回一个java值列表,其中每个值都已使用asObject()进行转换。
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值 如果可以将底层基础类型视为列表,则返回一个java值列表,其中每个值都已使用asObject()进行转换。
        Returns:
        如果可能,将值作为Java值列表
        See Also:
        asObject()
      • asList

        <T> List<T> asList​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction)
        如果可能的话,将值作为通过列表元素映射获得的T列表。
        Type Parameters:
        T - 目标列表元素的类型
        Parameters:
        mapFunction - 从Value映射到T的函数。有关某些预定义函数,请参阅Values,例如Values.ofBoolean(), Values.ofList(Function).
        Returns:
        如果可能的话,将值作为通过列表元素映射获得的T列表。
      • asList

        <T> List<T> asList​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction,
                           List<T> defaultValue)
        如果可能的话,将值作为通过列表元素映射获得的T列表。
        Type Parameters:
        T - 目标列表元素的类型
        Parameters:
        mapFunction - 从Value映射到T的函数。有关某些预定义函数,请参阅Values,例如Values.ofBoolean(), Values.ofList(Function).
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为通过列表元素映射获得的T列表。
      • asSet

        Set<Object> asSet()
        如果可以将底层基础类型视为集合,则返回一个java值集合,其中每个值都已使用asObject()进行转换。
        Returns:
        如果可能,将值作为Java值集合
      • asSet

        Set<Object> asSet​(Set<Object> defaultValue)
        如果可以将底层基础类型视为集合,则返回一个java值集合,其中每个值都已使用asObject()进行转换。
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能,将值作为Java值集合
      • asSet

        <T> Set<T> asSet​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction)
        如果可能的话,将值作为通过集合元素映射获得的T集合。
        Type Parameters:
        T - 目标集合元素的类型
        Parameters:
        mapFunction - 从Value映射到T的函数。有关某些预定义函数,请参阅Values,例如Values.ofBoolean(), Values.ofSet(Function).
        Returns:
        如果可能的话,将值作为通过集合元素映射获得的T集合。
        See Also:
        有一长串内置转换函数
      • asSet

        <T> Set<T> asSet​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction,
                         Set<T> defaultValue)
        如果可能的话,将值作为通过集合元素映射获得的T集合。
        Type Parameters:
        T - 目标集合元素的类型
        Parameters:
        mapFunction - 从Value映射到T的函数。有关某些预定义函数,请参阅Values,例如Values.ofBoolean(), Values.ofSet(Function).
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为通过集合元素映射获得的T集合。
        See Also:
        有一长串内置转换函数
      • asEntity

        com.graphdbapi.driver.v1.types.Entity asEntity()
        如果可能的话,将值作为 Entity
        Returns:
        如果可能的话,将值作为 Entity
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asNode

        com.graphdbapi.driver.v1.types.Node asNode()
        如果可能的话,将值作为 Node
        Returns:
        如果可能的话,将值作为 Node
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asRelationship

        com.graphdbapi.driver.v1.types.Relationship asRelationship()
        如果可能的话,将值作为 Relationship
        Returns:
        如果可能的话,将值作为 Relationship
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asEdge

        Edge asEdge​(Graph graph)
        如果可能的话,将值作为 Edge
        Parameters:
        graph - 图对象
        Returns:
        Edge
      • asPath

        com.graphdbapi.driver.v1.types.Path asPath()
        如果可能的话,将值作为 Path
        Returns:
        如果可能的话,将值作为 Path
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLocalDate

        LocalDate asLocalDate()
        如果可能的话,将值作为 Path
        Returns:
        如果可能的话,将值作为 Path
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asOffsetTime

        OffsetTime asOffsetTime()
        如果可能的话,将值作为 OffsetTime
        Returns:
        如果可能的话,将值作为 OffsetTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLocalTime

        LocalTime asLocalTime()
        如果可能的话,将值作为 LocalTime
        Returns:
        如果可能的话,将值作为 LocalTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLocalDateTime

        LocalDateTime asLocalDateTime()
        如果可能的话,将值作为 LocalDateTime
        Returns:
        如果可能的话,将值作为 LocalDateTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asZonedDateTime

        ZonedDateTime asZonedDateTime()
        如果可能的话,将值作为 ZonedDateTime
        Returns:
        如果可能的话,将值作为 ZonedDateTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asIsoDuration

        com.graphdbapi.driver.v1.types.IsoDuration asIsoDuration()
        如果可能的话,将值作为 IsoDuration
        Returns:
        如果可能的话,将值作为 IsoDuration
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asPoint

        com.graphdbapi.driver.v1.types.Point asPoint()
        如果可能的话,将值作为 Point
        Returns:
        如果可能的话,将值作为 Point
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLocalDate

        LocalDate asLocalDate​(LocalDate defaultValue)
        如果可能的话,将值作为 LocalDate
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 LocalDate
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asOffsetTime

        OffsetTime asOffsetTime​(OffsetTime defaultValue)
        如果可能的话,将值作为 OffsetTime
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 OffsetTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLocalTime

        LocalTime asLocalTime​(LocalTime defaultValue)
        如果可能的话,将值作为 LocalTime
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 LocalTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asLocalDateTime

        LocalDateTime asLocalDateTime​(LocalDateTime defaultValue)
        如果可能的话,将值作为 LocalDateTime
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 LocalDateTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asZonedDateTime

        ZonedDateTime asZonedDateTime​(ZonedDateTime defaultValue)
        如果可能的话,将值作为 ZonedDateTime
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 ZonedDateTime
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asIsoDuration

        com.graphdbapi.driver.v1.types.IsoDuration asIsoDuration​(com.graphdbapi.driver.v1.types.IsoDuration defaultValue)
        如果可能的话,将值作为 IsoDuration
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 IsoDuration
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asPoint

        com.graphdbapi.driver.v1.types.Point asPoint​(com.graphdbapi.driver.v1.types.Point defaultValue)
        如果可能的话,将值作为 Point
        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能的话,将值作为 Point
        Throws:
        com.graphdbapi.driver.v1.exceptions.value.Uncoercible - 如果值类型不兼容。
      • asMap

        Map<String,​Object> asMap​(Map<String,​Object> defaultValue)
        返回为字符串键和使用asObject()转换后的值的映射。

        这相当于用Values.ofObject()调用 asMap(Function, Map)

        Parameters:
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        作为Java map的值
      • asMap

        <T> Map<String,​T> asMap​(com.graphdbapi.driver.v1.util.Function<Value,​T> mapFunction,
                                      Map<String,​T> defaultValue)
        返回为字符串键和使用asObject()转换后的值的映射。
        Type Parameters:
        T - 目标map元素的类型
        Parameters:
        mapFunction - 从Value映射到T的函数。有关某些预定义函数,请参阅Values,例如Values.ofBoolean(), Values.ofList(Function).
        defaultValue - 如果值为NullValue,则默认为此值
        Returns:
        如果可能,将值作为从字符串键到映射原始映射值的类型T的值的映射