maedhroz commented on code in PR #3095:
URL: https://github.com/apache/cassandra/pull/3095#discussion_r1589422384


##########
src/java/org/apache/cassandra/schema/ColumnMetadata.java:
##########
@@ -556,6 +555,22 @@ public AbstractType<?> getExactTypeIfKnown(String keyspace)
         return type;
     }
 
+    /**
+     * Returns the types of the differents columns.
+     *
+     * @param columns the columns for which the types must be returned.
+     * @return the types of the differents columns.
+     */
+    public static List<AbstractType<?>> typesOf(List<ColumnMetadata> columns)
+    {
+        List<AbstractType<?>> types = new ArrayList<>(columns.size());
+        for (ColumnMetadata column : columns)
+        {
+            types.add(column.type);
+        }
+        return types;

Review Comment:
   Would be a sweet on-liner...
   ```
   return columns.stream().map(c -> c.type).collect(Collectors.toList());
   ```
   ...but it's probably too bloated, unless the compiler has gotten smarter :D



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