Sets a property value only if the value is not null.

@param key the key for the property
@param value the value for the property
433545
public void setStringIfNotNull(@NotNull final String key, @Nullable final String value) {
        if (null != value) {
            setString(key, value);
        }
    }
1064338
public void setInt(@NotNull final String key, @NotNull final int value) {
        props.setProperty(key, String.valueOf(value));
        LOGGER.debug("Setting: {}='{}'", key, value);
    }
903297
public <T> void set(String key, T value) {
		Preconditions.checkArgument(key != null && !key.isEmpty(), "Parameter 'key' must not be [" + key + "]");
		values.put(key, value);
		scope.put(key, scope, value);
	}
307063
@Override
    public void setAttribute(String key, Object value) {
        if (value == null) {
            setAttribute(key, null);
        } else {
            setAttribute(key, Collections.singletonList(value));
        }
    }
1180849
public static void setAttribute(String key, Object value) {
        assertInitialized();
        getAppFramework().setAttribute(key, value);
    }
1251493
public void put(K key, V value) {
        checkNotNull(key, "Key cannot be null");
        checkNotNull(value, "Value cannot be null");

        Set<V> values = backingMap.get(key);
        if (values == null) {
            values = new HashSet<V>();
            backingMap.put(key, values);
        }
        values.add(value);
    }
16221
public void setBoolean(Enum<?> key, boolean value)
    {
        if (key == null)
        {
            return;
        }

        setBoolean(key.name(), value);
    }
482798
public void put(T key, Object value) {
        data.put(key, ensureValueCorrectness(key, value));
    }
511873
public void setValue(String key, String value) {
        KeyValue kv = getKV(key);
        if (kv != null) {
            kv.setValue(value);
        } else if (key != null) {
            map.add(new KeyValue(key,value));
        }
    }
1268233
public synchronized void put(@NonNull String key, @Nullable String value) {
    if (value == null) {
      putNull(key);
      return;
    }

    try {
      this.content.put(key, value);
    } catch (JSONException je) {
      Log.e(TAG, "Failed json encode value: " + String.valueOf(value));
    }
  }
757874
public void set(String key, Object value) {
    if (!StringUtil.isEmpty(key) && null != value) {
      pendingInstanceData.put(key, value);
    }
  }
635604
public void setAttribute(Object key, Object value) {
		if (attributes == null) {
			attributes = new HashMap(5);
		}
		attributes.put(key, value);
	}
1207330
public void setRequestProperty(String key, Object value) {
		if (value != null) {
			if (requestProperties == null) {
				requestProperties = new HashMap<>();
			}
			requestProperties.put(key, value);
		}
	}
198294
public void put(Key key, Value val) {
		if (val == null) st.remove(key);
		else             st.put(key, val);
	}
342190
private static void setSimpleValue(Object obj, Property property, Object value) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyName.");
        }

        property.set(obj, value);
    }
907832
public void set(PropertyKey key, String value) {
    put(key, value, Source.RUNTIME);
  }
868964
public void put(final String key, final String value) {
        if (value == null) {
            throw new IllegalArgumentException("No value provided for key " + key);
        }
        validate(key, value);
        data.putValue(key, value);
    }