From 17614362f2550c29dcd746ee2c1bc01d0df5de65 Mon Sep 17 00:00:00 2001 From: Ravi Pendurty Date: Tue, 25 May 2021 18:57:29 +0530 Subject: Improve Websocket notification interface Improve websocket notification interface Issue-ID: CCSDK-3315 Signed-off-by: Ravi Pendurty Change-Id: I0ded865adddb546ade98df4760e0a32ec964295a Signed-off-by: Ravi Pendurty --- .../features/sdnr/wt/yang/mapper/YangToolsMapperHelper.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sdnr/wt/common-yang/utils') diff --git a/sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapperHelper.java b/sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapperHelper.java index ac6b1b5c5..3086167bf 100644 --- a/sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapperHelper.java +++ b/sdnr/wt/common-yang/utils/src/main/java/org/onap/ccsdk/features/sdnr/wt/yang/mapper/YangToolsMapperHelper.java @@ -219,7 +219,7 @@ public class YangToolsMapperHelper { return true; } } - return false; + return ifToImplement.isAssignableFrom(clz); } /** @@ -235,7 +235,12 @@ public class YangToolsMapperHelper { final StringBuilder ret = new StringBuilder(name.length()); if (!name.startsWith("_")) ret.append('_'); + ret.append(toCamelCase(name)); + return ret.toString(); + } + public static String toCamelCase(final String name) { int start = 0; + final StringBuilder ret = new StringBuilder(name.length()); for (final String word : name.split("-")) { if (!word.isEmpty()) { if (start++ == 0) { @@ -248,7 +253,10 @@ public class YangToolsMapperHelper { } return ret.toString(); } - + public static String toCamelCaseClassName(final String name) { + final String clsName = toCamelCase(name); + return clsName.substring(0,1).toUpperCase()+clsName.substring(1); + } private static BundleContext getBundleContext() { Bundle bundle = FrameworkUtil.getBundle(YangToolsMapperHelper.class); return bundle != null ? bundle.getBundleContext() : null; -- cgit 1.2.3-korg