adamsaghy commented on code in PR #4307:
URL: https://github.com/apache/fineract/pull/4307#discussion_r1951380300


##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/dataqueries/data/ResultsetColumnHeaderData.java:
##########
@@ -239,40 +217,25 @@ private DisplayType calcDisplayType() {
     }
 
     public static DisplayType calcColumnDisplayType(JdbcJavaType columnType) {
-        if (columnType.isTextType()) {
-            return DisplayType.TEXT;
-        }
-        if (columnType.isStringType()) {
-            return DisplayType.STRING;
-        }
-        if (columnType.isAnyIntegerType()) {
-            return DisplayType.INTEGER;
-        }
-        if (columnType.isAnyFloatType()) {
-            return DisplayType.FLOAT;
-        }
-        if (columnType.isDecimalType()) { // Refer 
org.drizzle.jdbc.internal.mysql.MySQLType.java
-            return DisplayType.DECIMAL;
-        }
-        if (columnType.isDateType()) {
-            return DisplayType.DATE;
-        }
-        if (columnType.isDateTimeType()) {
-            return DisplayType.DATETIME;
-        }
-        if (columnType.isTimeType()) {
-            return DisplayType.TIME;
-        }
-        if (columnType.isBooleanType()) {
-            return DisplayType.BOOLEAN;
-        }
-        if (columnType.isBinaryType()) {
-            return DisplayType.BINARY;
-        }
-        return null;
+        Map<Predicate<JdbcJavaType>, DisplayType> typeMap = new 
LinkedHashMap<>();
+
+        typeMap.put(JdbcJavaType::isTextType, DisplayType.TEXT);

Review Comment:
   Using switch-case would be better...



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