@Override
        public V setValue(V value) {
            V oldValue = delegate.setValue(value);
            K key = delegate.getKey();
            if (key instanceof String) {
                if (value instanceof String) {
                    if (oldValue == null) {
                        insertProperty((String) key, (String) value);
                    } else if (!value.equals(oldValue)) {
                        updateProperty((String)key,(String)value, (String)oldValue);
                    }
                } else {
                    deleteProperty((String)key, (oldValue instanceof String) ? (String)oldValue : null);
                }
            }
            return oldValue;
        }
Set the value of the property corresponding to this entry. This
method also updates the database as needed depending on the new
property value. A null value will cause the property to be deleted
from the database.

@param value The new property value
@return The old value of the corresponding property
xmppserver/src/main/java/org/jivesoftware/openfire/group/DefaultGroupPropertyMap.java