nl.topicus.jdbc.util

## Class CloudSpannerConversionUtil

- java.lang.Object
- - nl.topicus.jdbc.util.CloudSpannerConversionUtil

    public class CloudSpannerConversionUtil
    extends Object

### Method Summary

All Methods Static Methods Concrete Methods
`static Object` `convert(Object value, com.google.cloud.spanner.Type type, Class<?> targetType)` Converts the given value from the Google `Type` to the Java `Class` type.
`static List<com.google.cloud.ByteArray>` `toCloudSpannerBytes(byte[][] bytes)`
`static com.google.cloud.Date` `toCloudSpannerDate(Date date)`
`static List<com.google.cloud.Date>` `toCloudSpannerDates(Date[] dates)`
`static com.google.cloud.Timestamp` `toCloudSpannerTimestamp(Timestamp ts)`
`static List<com.google.cloud.Timestamp>` `toCloudSpannerTimestamps(Timestamp[] timestamps)`
`static List<byte[]>` `toJavaByteArrays(List<com.google.cloud.ByteArray> bytes)`
`static List<Date>` `toJavaDates(List<com.google.cloud.Date> dates)`
`static List<Timestamp>` `toJavaTimestamps(List<com.google.cloud.Timestamp> timestamps)`
`static Date` `toSqlDate(com.google.cloud.Date date)`
`static Date` `toSqlDate(com.google.cloud.Date date, Calendar cal)`
`static Time` `toSqlTime(com.google.cloud.Timestamp ts)`
`static Time` `toSqlTime(com.google.cloud.Timestamp ts, Calendar cal)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### toSqlDate

    public static Date toSqlDate(com.google.cloud.Date date)

#### toSqlDate

    public static Date toSqlDate(com.google.cloud.Date date,
                                 Calendar cal)

#### toCloudSpannerDate

    public static com.google.cloud.Date toCloudSpannerDate(Date date)

#### toCloudSpannerDates

    public static List<com.google.cloud.Date> toCloudSpannerDates(Date[] dates)

#### toJavaDates

    public static List<Date> toJavaDates(List<com.google.cloud.Date> dates)

#### toCloudSpannerTimestamp

    public static com.google.cloud.Timestamp toCloudSpannerTimestamp(Timestamp ts)

#### toCloudSpannerTimestamps

    public static List<com.google.cloud.Timestamp> toCloudSpannerTimestamps(Timestamp[] timestamps)

#### toSqlTime

    public static Time toSqlTime(com.google.cloud.Timestamp ts)

#### toSqlTime

    public static Time toSqlTime(com.google.cloud.Timestamp ts,
                                 Calendar cal)

#### toJavaTimestamps

    public static List<Timestamp> toJavaTimestamps(List<com.google.cloud.Timestamp> timestamps)

#### toCloudSpannerBytes

    public static List<com.google.cloud.ByteArray> toCloudSpannerBytes(byte[][] bytes)

#### toJavaByteArrays

    public static List<byte[]> toJavaByteArrays(List<com.google.cloud.ByteArray> bytes)

#### convert

    public static Object convert(Object value,
                                 com.google.cloud.spanner.Type type,
                                 Class<?> targetType)
                          throws CloudSpannerSQLException

Converts the given value from the Google `Type` to the Java `Class` type.

Parameters:
  `value` - The value to convert
  `type` - The type in the database
  `targetType` - The java class target type to convert to
Returns:
  The converted value
Throws:
  `CloudSpannerSQLException`