@Test public void testSetStringArray() throws IOException { List<String> quotes = ImmutableList.of("abracadabra", "hocuspocus"); accessor.setStringArray("favorite_quotes", quotes); Assert.assertEquals(accessor.getGeneric("favorite_quotes"), quotes); }
@Override public void setStringArray(String fieldName, List<String> value) { GenericData.Array<String> avroArray = new GenericData.Array<>( Schema.createArray(Schema.create(Schema.Type.STRING)), value); set(fieldName, avroArray); }
AvroGenericRecordAccessor implements RecordAccessor { @Override public void setStringArray(String fieldName, List<String> value) { GenericData.Array<String> avroArray = new GenericData.Array<>( Schema.createArray(Schema.create(Schema.Type.STRING)), value); set(fieldName, avroArray); } }
AvroGenericRecordAccessor implements RecordAccessor { @Override public void setStringArray(String fieldName, List<String> value) { GenericData.Array<String> avroArray = new GenericData.Array<>( Schema.createArray(Schema.create(Schema.Type.STRING)), value); set(fieldName, avroArray); } AvroGenericRecordAccessor(GenericRecord record); }
AvroGenericRecordAccessor implements RecordAccessor { @Override public void setStringArray(String fieldName, List<String> value) { GenericData.Array<String> avroArray = new GenericData.Array<>( Schema.createArray(Schema.create(Schema.Type.STRING)), value); set(fieldName, avroArray); } AvroGenericRecordAccessor(GenericRecord record); @Override Map<String, String> getMultiAsString(String fieldName); @Override String getAsString(String fieldName); @Override Map<String, Integer> getMultiAsInt(String fieldName); @Override Integer getAsInt(String fieldName); @Override Map<String, Long> getMultiAsLong(String fieldName); @Override Long getAsLong(String fieldName); @Override Map<String, Object> getMultiGeneric(String fieldName); @Override Object getGeneric(String fieldName); @Override void set(String fieldName, String value); @Override void set(String fieldName, Integer value); @Override void set(String fieldName, Long value); @Override void setStringArray(String fieldName, List<String> value); @Override void setToNull(String fieldName); }
AvroGenericRecordAccessor implements RecordAccessor { @Override public void setStringArray(String fieldName, List<String> value) { GenericData.Array<String> avroArray = new GenericData.Array<>( Schema.createArray(Schema.create(Schema.Type.STRING)), value); set(fieldName, avroArray); } AvroGenericRecordAccessor(GenericRecord record); @Override Map<String, String> getMultiAsString(String fieldName); @Override String getAsString(String fieldName); @Override Map<String, Integer> getMultiAsInt(String fieldName); @Override Integer getAsInt(String fieldName); @Override Map<String, Long> getMultiAsLong(String fieldName); @Override Long getAsLong(String fieldName); @Override Map<String, Object> getMultiGeneric(String fieldName); @Override Object getGeneric(String fieldName); @Override void set(String fieldName, String value); @Override void set(String fieldName, Integer value); @Override void set(String fieldName, Long value); @Override void setStringArray(String fieldName, List<String> value); @Override void setToNull(String fieldName);  }