@Test public void testInvalidColumnLabel() { SpannerRow row = new SpannerRow( new ArrayList<>(), this.rowMetadata); assertThatThrownBy(() -> row.get("foobar", String.class)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("The column name foobar does not exist for the Spanner row."); }
@Override public <T> T get(int columnIndex, Class<T> returnType) { Value spannerValue = this.values.get(columnIndex); Type spannerType = (Type) this.rowMetadata.getColumnMetadata(columnIndex) .getNativeTypeMetadata(); T decodedValue = codecs.decode(spannerValue, spannerType, returnType); return decodedValue; }
SpannerRow implements Row { @Override public <T> T get(int columnIndex, Class<T> returnType) { Value spannerValue = this.values.get(columnIndex); Type spannerType = (Type) this.rowMetadata.getColumnMetadata(columnIndex) .getNativeTypeMetadata(); T decodedValue = codecs.decode(spannerValue, spannerType, returnType); return decodedValue; } }
SpannerRow implements Row { @Override public <T> T get(int columnIndex, Class<T> returnType) { Value spannerValue = this.values.get(columnIndex); Type spannerType = (Type) this.rowMetadata.getColumnMetadata(columnIndex) .getNativeTypeMetadata(); T decodedValue = codecs.decode(spannerValue, spannerType, returnType); return decodedValue; } SpannerRow(List<Value> values, SpannerRowMetadata rowMetadata); }
SpannerRow implements Row { @Override public <T> T get(int columnIndex, Class<T> returnType) { Value spannerValue = this.values.get(columnIndex); Type spannerType = (Type) this.rowMetadata.getColumnMetadata(columnIndex) .getNativeTypeMetadata(); T decodedValue = codecs.decode(spannerValue, spannerType, returnType); return decodedValue; } SpannerRow(List<Value> values, SpannerRowMetadata rowMetadata); @Override T get(int columnIndex, Class<T> returnType); @Override T get(String columnName, Class<T> returnType); List<Value> getValues(); SpannerRowMetadata getRowMetadata(); }
SpannerRow implements Row { @Override public <T> T get(int columnIndex, Class<T> returnType) { Value spannerValue = this.values.get(columnIndex); Type spannerType = (Type) this.rowMetadata.getColumnMetadata(columnIndex) .getNativeTypeMetadata(); T decodedValue = codecs.decode(spannerValue, spannerType, returnType); return decodedValue; } SpannerRow(List<Value> values, SpannerRowMetadata rowMetadata); @Override T get(int columnIndex, Class<T> returnType); @Override T get(String columnName, Class<T> returnType); List<Value> getValues(); SpannerRowMetadata getRowMetadata();  }