@Trivial
    public static String stripSecretsFromParameters(Map<String, String[]> pMap, String[] secretStrings) {
        String retVal = null;
        if (pMap != null && pMap.size() > 0) {
            java.util.List<String> secretList = null;
            if (secretStrings != null && secretStrings.length != 0) {
                secretList = java.util.Arrays.asList(secretStrings);
            } else {
                secretList = new ArrayList();
            }

            StringBuffer sb = new StringBuffer();
            java.util.Set<String> keys = pMap.keySet();
            for (String key : keys) {
                sb.append("{" + key + "=");
                if (secretList.contains(key)) {
                    sb.append("*****");
                } else {
                    String[] values = pMap.get(key);
                    sb.append(java.util.Arrays.toString(values));
                }
                sb.append("}");
            }
            retVal = sb.toString();
        }
        return retVal;
    }
@ Trivial public static String stripSecretsFromParameters ( Map < String , String [ ] > pMap , String [ ] secretStrings ) { String retVal = null ; if ( pMap != null && pMap . size ( ) > 0 ) { java . util . List < String > secretList = null ; if ( secretStrings != null && secretStrings . length != 0 ) { secretList = java . util . Arrays . asList ( secretStrings ) ; } else { secretList = new ArrayList ( ) ; } StringBuffer sb = new StringBuffer ( ) ; java . util . Set < String > keys = pMap . keySet ( ) ; for ( String key : keys ) { sb . append ( "{" + key + "=" ) ; if ( secretList . contains ( key ) ) { sb . append ( "*****" ) ; } else { String [ ] values = pMap . get ( key ) ; sb . append ( java . util . Arrays . toString ( values ) ) ; } sb . append ( "}" ) ; } retVal = sb . toString ( ) ; } return retVal ; }
for any parameter that matches secret with *****