@Test public void testGetStringArrayUtf8() throws IOException { List<String> expectedQuotes = ImmutableList.of("abc", "defg"); GenericData.Array<Utf8> strings = new GenericData.Array<Utf8>(2, Schema.createArray(Schema.create(Schema.Type.STRING))); expectedQuotes.forEach(s -> strings.add(new Utf8(s))); record.put("favorite_quotes", strings); Assert.assertEquals(accessor.getGeneric("favorite_quotes"), expectedQuotes); }
@Override public Object getGeneric(String fieldName) { Object val = getAsObject(fieldName); return convertAvroToJava(fieldName, val); }
AvroGenericRecordAccessor implements RecordAccessor { @Override public Object getGeneric(String fieldName) { Object val = getAsObject(fieldName); return convertAvroToJava(fieldName, val); } }
AvroGenericRecordAccessor implements RecordAccessor { @Override public Object getGeneric(String fieldName) { Object val = getAsObject(fieldName); return convertAvroToJava(fieldName, val); } AvroGenericRecordAccessor(GenericRecord record); }
AvroGenericRecordAccessor implements RecordAccessor { @Override public Object getGeneric(String fieldName) { Object val = getAsObject(fieldName); return convertAvroToJava(fieldName, val); } 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 Object getGeneric(String fieldName) { Object val = getAsObject(fieldName); return convertAvroToJava(fieldName, val); } 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);  }