private static Map buildArrayBinderMap()

in cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerType.java [110:123]


  private static Map<Code, IterableStatementBinder> buildArrayBinderMap() {
    Map<Code, IterableStatementBinder> map = new EnumMap<>(Code.class);
    map.put(Code.BOOL, (b, i) -> b.toBoolArray((Iterable<Boolean>) i));
    map.put(Code.INT64, (b, i) -> b.toInt64Array((Iterable<Long>) i));
    map.put(Code.NUMERIC, (b, i) -> b.toNumericArray((Iterable<BigDecimal>) i));
    map.put(Code.FLOAT64, (b, i) -> b.toFloat64Array((Iterable<Double>) i));
    map.put(Code.STRING, (b, i) -> b.toStringArray((Iterable<String>) i));
    map.put(Code.BYTES, (b, i) -> b.toBytesArray((Iterable<ByteArray>) i));
    map.put(Code.TIMESTAMP, (b, i) -> b.toTimestampArray((Iterable<Timestamp>) i));
    map.put(Code.DATE, (b, i) -> b.toDateArray((Iterable<Date>) i));
    // no JSON, ARRAY, STRUCT for now

    return map;
  }