From 754f013b4d2406a50839120287b3f9d13826e165 Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Tue, 29 Oct 2024 13:58:36 +0900 Subject: [PATCH] convert Set too --- .../ansible/rulebook/integration/api/LogUtil.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java b/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java index 75a97da..d1732b9 100644 --- a/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java +++ b/drools-ansible-rulebook-integration-api/src/main/java/org/drools/ansible/rulebook/integration/api/LogUtil.java @@ -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 { @@ -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) { @@ -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(); }