rdblue commented on code in PR #16936:
URL: https://github.com/apache/iceberg/pull/16936#discussion_r4187892087


##########
api/src/main/java/org/apache/iceberg/geospatial/GeospatialBound.java:
##########
@@ -282,6 +283,27 @@ public boolean hasM() {
     return !Double.isNaN(m);
   }
 
+  @Override
+  public int size() {
+    return 4;
+  }
+
+  @Override
+  public <T> T get(int pos, Class<T> javaClass) {
+    return switch (pos) {
+      case 0 -> javaClass.cast(x);
+      case 1 -> javaClass.cast(y);
+      case 2 -> hasZ() ? javaClass.cast(z) : null;
+      case 3 -> hasM() ? javaClass.cast(m) : null;
+      default -> throw new IllegalArgumentException("Invalid position: " + 
pos);
+    };
+  }
+
+  @Override
+  public <T> void set(int pos, T value) {
+    throw new UnsupportedOperationException("GeospatialBound is read only");

Review Comment:
   Not part of this PR, but should we use `GeospatialBound` when reading? I 
think right now we use a generic struct for it but we could use this.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to