Row implements Serializable { public static Row nullRow(Schema schema) { return Row.withSchema(schema) .addValues(Collections.nCopies(schema.getFieldCount(), null)) .build(); } Row(Schema schema); @Nullable @SuppressWarnings("TypeParameterUnusedInFormals") abstract T getValue(int fieldIdx); abstract int getFieldCount(); abstract List<Object> getValues(); List<Object> getBaseValues(); @Nullable @SuppressWarnings("TypeParameterUnusedInFormals") T getValue(String fieldName); @Nullable Byte getByte(String fieldName); byte @Nullable [] getBytes(String fieldName); @Nullable Short getInt16(String fieldName); @Nullable Integer getInt32(String fieldName); @Nullable Long getInt64(String fieldName); @Nullable BigDecimal getDecimal(String fieldName); @Nullable Float getFloat(String fieldName); @Nullable Double getDouble(String fieldName); @Nullable String getString(String fieldName); @Nullable ReadableDateTime getDateTime(String fieldName); @Nullable Boolean getBoolean(String fieldName); @Nullable Collection<T> getArray(String fieldName); @Nullable Iterable<T> getIterable(String fieldName); @Nullable Map<T1, T2> getMap(String fieldName); @Nullable T getLogicalTypeValue(String fieldName, Class<T> clazz); @Nullable T getBaseValue(String fieldName, Class<T> clazz); @Nullable Object getBaseValue(String fieldName); @Nullable Row getRow(String fieldName); @Nullable Byte getByte(int idx); byte @Nullable [] getBytes(int idx); @Nullable Short getInt16(int idx); @Nullable Integer getInt32(int idx); @Nullable Float getFloat(int idx); @Nullable Double getDouble(int idx); @Nullable Long getInt64(int idx); @Nullable String getString(int idx); @Nullable ReadableDateTime getDateTime(int idx); @Nullable BigDecimal getDecimal(int idx); @Nullable Boolean getBoolean(int idx); @Nullable Collection<T> getArray(int idx); @Nullable Iterable<T> getIterable(int idx); @Nullable Map<T1, T2> getMap(int idx); @Nullable T getLogicalTypeValue(int idx, Class<T> clazz); @Nullable T getBaseValue(int idx, Class<T> clazz); @Nullable Object getBaseValue(int idx); @Nullable Row getRow(int idx); Schema getSchema(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); static Builder withSchema(Schema schema); static FieldValueBuilder fromRow(Row row); static Collector<T, List<Object>, Row> toRow(Schema schema); static Row nullRow(Schema schema);  }
@Test public void testRejectsNullRecord() { Schema type = Stream.of(Schema.Field.of("f_int", Schema.FieldType.INT32)).collect(toSchema()); thrown.expect(IllegalArgumentException.class); Row.nullRow(type); }