Skip to content

Commit

Permalink
convert Set too
Browse files Browse the repository at this point in the history
  • Loading branch information
tkobayas committed Oct 29, 2024
1 parent b8de3e2 commit 754f013
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package org.drools.ansible.rulebook.integration.api;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import java.util.Set;

public class LogUtil {

Expand All @@ -18,12 +15,7 @@ private LogUtil() {
Integer.class, "int",
Boolean.class, "bool",
String.class, "str",
Double.class, "float",
List.class, "list",
ArrayList.class, "list",
Map.class, "dict",
LinkedHashMap.class, "dict",
HashMap.class, "dict"
Double.class, "float"
);

public static String convertJavaClassToPythonClass(Class<?> javaClass) {
Expand All @@ -34,6 +26,8 @@ public static String convertJavaClassToPythonClass(Class<?> javaClass) {
return "list";
} else if (Map.class.isAssignableFrom(javaClass)) {
return "dict";
} else if (Set.class.isAssignableFrom(javaClass)) {
return "set";
}
return javaClass.getSimpleName();
}
Expand Down

0 comments on commit 754f013

Please sign in to comment.