tilgalas commented on code in PR #32081:
URL: https://github.com/apache/beam/pull/32081#discussion_r1816518505


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/values/RowWithGetters.java:
##########
@@ -42,45 +42,43 @@
  * the appropriate fields from the POJO.
  */
 @SuppressWarnings("rawtypes")
-public class RowWithGetters extends Row {
-  private final Object getterTarget;
-  private final List<FieldValueGetter> getters;
+public class RowWithGetters<T extends @NonNull Object> extends Row {
+  private final T getterTarget;
+  private final List<FieldValueGetter<T, ?>> getters;
   private @Nullable Map<Integer, @Nullable Object> cache = null;
 
   RowWithGetters(
-      Schema schema, Factory<List<FieldValueGetter>> getterFactory, Object 
getterTarget) {
+      Schema schema, Factory<List<FieldValueGetter<T, ?>>> getterFactory, T 
getterTarget) {
     super(schema);
     this.getterTarget = getterTarget;
     this.getters = 
getterFactory.create(TypeDescriptor.of(getterTarget.getClass()), schema);
   }
 
   @Override
   @SuppressWarnings({"TypeParameterUnusedInFormals", "unchecked"})
-  public <T> @Nullable T getValue(int fieldIdx) {
+  public @Nullable Object getValue(int fieldIdx) {

Review Comment:
   I feel like I will change the type of the list elements to 
`FieldValueGetter<T, Object>` anyway, as I find it more correct



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to