@Test public void getStrColumnsValid() throws Exception { final String aKey = "aKey"; final GlobalSessionObject<Map<String, Object>> globalSessionObject = new GlobalSessionObject<>(); final Map<String, Object> stringMap = new HashMap<>(); stringMap.put(aKey, aKey); globalSessionObject.setResource(new SQLSessionResource(stringMap)); assertThat(getStrColumns(globalSessionObject, aKey), is(aKey)); }
@NotNull public static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol) { final Map<String, Object> globalMap = globalSessionObject.get(); if (globalMap.containsKey(strKeyCol) && globalMap.get(strKeyCol) instanceof String) { try { return (String) globalMap.get(strKeyCol); } catch (Exception e) { globalMap.remove(strKeyCol); globalSessionObject.setResource(new SQLSessionResource(globalMap)); } } return EMPTY; }
SQLUtils { @NotNull public static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol) { final Map<String, Object> globalMap = globalSessionObject.get(); if (globalMap.containsKey(strKeyCol) && globalMap.get(strKeyCol) instanceof String) { try { return (String) globalMap.get(strKeyCol); } catch (Exception e) { globalMap.remove(strKeyCol); globalSessionObject.setResource(new SQLSessionResource(globalMap)); } } return EMPTY; } }
SQLUtils { @NotNull public static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol) { final Map<String, Object> globalMap = globalSessionObject.get(); if (globalMap.containsKey(strKeyCol) && globalMap.get(strKeyCol) instanceof String) { try { return (String) globalMap.get(strKeyCol); } catch (Exception e) { globalMap.remove(strKeyCol); globalSessionObject.setResource(new SQLSessionResource(globalMap)); } } return EMPTY; }  }
SQLUtils { @NotNull public static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol) { final Map<String, Object> globalMap = globalSessionObject.get(); if (globalMap.containsKey(strKeyCol) && globalMap.get(strKeyCol) instanceof String) { try { return (String) globalMap.get(strKeyCol); } catch (Exception e) { globalMap.remove(strKeyCol); globalSessionObject.setResource(new SQLSessionResource(globalMap)); } } return EMPTY; }  static void loadClassForName(@NotNull final String className); static String processNullTerminatedString(final String value); static String getIPv4OrIPv6WithSquareBracketsHost(String dbServer); static String exceptionToString(Throwable e); static String toString(SQLException e); @NotNull static String computeSessionId(@NotNull final String aString); static String processDumpException(SQLException sqlException); static String processLoadException(SQLException e); static List<String> readFromFile(String fileName); @NotNull static List<String> getRowsFromGlobalSessionMap(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String aKey); @NotNull static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol); }
SQLUtils { @NotNull public static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol) { final Map<String, Object> globalMap = globalSessionObject.get(); if (globalMap.containsKey(strKeyCol) && globalMap.get(strKeyCol) instanceof String) { try { return (String) globalMap.get(strKeyCol); } catch (Exception e) { globalMap.remove(strKeyCol); globalSessionObject.setResource(new SQLSessionResource(globalMap)); } } return EMPTY; }  static void loadClassForName(@NotNull final String className); static String processNullTerminatedString(final String value); static String getIPv4OrIPv6WithSquareBracketsHost(String dbServer); static String exceptionToString(Throwable e); static String toString(SQLException e); @NotNull static String computeSessionId(@NotNull final String aString); static String processDumpException(SQLException sqlException); static String processLoadException(SQLException e); static List<String> readFromFile(String fileName); @NotNull static List<String> getRowsFromGlobalSessionMap(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String aKey); @NotNull static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol);  }