thahn27 commented on code in PR #634:
URL: https://github.com/apache/ofbiz-framework/pull/634#discussion_r1188689165


##########
framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java:
##########
@@ -123,6 +123,117 @@ public static String 
getPropertyValueFromDelegatorName(String resource, String n
         }
     }
 
+    public static <T> Object getPropertyValue(String resource, String name, 
Object defaultValue, Delegator delegator, Class<T> clazz) {
+        Map<String, String> propMap = getSystemPropertyValue(resource, name, 
delegator);
+        if ("Y".equals(propMap.get("isExistInDb"))) {
+            String s = propMap.get("value");
+            if (UtilValidate.isEmpty(s)) {
+                return defaultValue;
+            }
+            try {
+                if (clazz.componentType() == Integer.class) {

Review Comment:
   Hey @gilPts ,
   
   i tried to implement the switch statement instead of the if statements and i 
can't really make it work. The pattern matching documentation in the ref you 
provided works with objects which have been instantiated before. Maybe stick to 
the if statements? 
   Maybe you could provide an example or explain how you would implement such 
switch statement.
   
   Thanks and regards,
   Tobias



-- 
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: notifications-unsubscr...@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to