@Override
    public synchronized Object put(Object key, Object value) {
        if (value instanceof String
                && key instanceof String) {
            boolean append = ((String) key).endsWith("+");
            boolean remove = ((String) key).endsWith("-");
            if (append || remove) {
                key = ((String) key).substring(0, ((String) key).length() - 1);
                Object v = linkMap.get(key);
                if (v instanceof String) {
                    if (append) {
                        value = v + "," + value;
                    } else {
                        value = ((String) v).replaceAll(Pattern.quote((String) value), "").replaceAll(",{2,}", ",");
                    }
                } else if (remove) {
                    key = null;
                }
            }
        }
        if (key != null)
            return linkMap.put(key, value);
        else return null;
    }
@ Override public synchronized Object put ( Object key , Object value ) { if ( value instanceof String && key instanceof String ) { boolean append = ( ( String ) key ) . endsWith ( "+" ) ; boolean remove = ( ( String ) key ) . endsWith ( "-" ) ; if ( append || remove ) { key = ( ( String ) key ) . substring ( 0 , ( ( String ) key ) . length ( ) - 1 ) ; Object v = linkMap . get ( key ) ; if ( v instanceof String ) { if ( append ) { value = v + "," + value ; } else { value = ( ( String ) v ) . replaceAll ( Pattern . quote ( ( String ) value ) , "" ) . replaceAll ( ",{2,}" , "," ) ; } } else if ( remove ) { key = null ; } } } if ( key != null ) return linkMap . put ( key , value ) ; else return null ; }
{@inheritDoc}