@Override
    public void set(String key, @Sensitive Object value) {
        Object tempValue = value;

        if (isSensitive(key)) {
            if (value == null) {
                tempValue = ProtectedString.NULL_PROTECTED_STRING;
            } else if (value instanceof String) {
                if (((String) value).isEmpty()) {
                    tempValue = ProtectedString.EMPTY_PROTECTED_STRING;
                } else {
                    tempValue = new ProtectedString(((String) value).toCharArray());
                }
            } else if (value instanceof char[]) {
                tempValue = new ProtectedString((char[]) value);
            } else if (value instanceof ProtectedString) {
                tempValue = value;
            } else {
                throw new IllegalArgumentException("Setting a password into WSAuthenticationData expects the stored Object to be either a String, char[] or ProtectedString. Instead, stored Object was of type "
                                                   + value.getClass().getName());
            }
        }
@ Override public void set ( String key , @ Sensitive Object value ) { Object tempValue = value ; if ( isSensitive ( key ) ) { if ( value == null ) { tempValue = ProtectedString . NULL_PROTECTED_STRING ; } else if ( value instanceof String ) { if ( ( ( String ) value ) . isEmpty ( ) ) { tempValue = ProtectedString . EMPTY_PROTECTED_STRING ; } else { tempValue = new ProtectedString ( ( ( String ) value ) . toCharArray ( ) ) ; } } else if ( value instanceof char [ ] ) { tempValue = new ProtectedString ( ( char [ ] ) value ) ; } else if ( value instanceof ProtectedString ) { tempValue = value ; } else { throw new IllegalArgumentException ( "Setting a password into WSAuthenticationData expects the stored Object to be either a String, char[] or ProtectedString. Instead, stored Object was of type " + value . getClass ( ) . getName ( ) ) ; } }
Sets the key-value pair.

@param key
@param value