Write a value in a given key/value name

@param hk the HKEY to be used
@param key the key to be written
@param valueName the value name
@param value the value
@throws RegistryException when something is not right
975690
public void writeStringValue(HKey hk, String key, String valueName, String value) throws RegistryException {
		try {
			ReflectedMethods.writeStringValue(hk.root(), hk.hex(), key, valueName, value);
		} catch (Exception e) {
			throw new RegistryException("Cannot write " + valueName + " value " + value + " in key " + key, e);
		}
	}
1202266
private static String registryGet32StringValue(com.sun.jna.platform.win32.WinReg.HKEY root, String key, String value)
      throws com.sun.jna.platform.win32.Win32Exception {
    com.sun.jna.platform.win32.WinReg.HKEYByReference phkKey = new com.sun.jna.platform.win32.WinReg.HKEYByReference();
    int rc = com.sun.jna.platform.win32.Advapi32.INSTANCE.RegOpenKeyEx(root, key, 0,
        com.sun.jna.platform.win32.WinNT.KEY_READ | com.sun.jna.platform.win32.WinNT.KEY_WOW64_32KEY, phkKey);
    if (rc != com.sun.jna.platform.win32.W32Errors.ERROR_SUCCESS) {
      throw new com.sun.jna.platform.win32.Win32Exception(rc);
    }
    try {
      return com.sun.jna.platform.win32.Advapi32Util.registryGetStringValue(phkKey.getValue(), value);
    } finally {
      rc = com.sun.jna.platform.win32.Advapi32.INSTANCE.RegCloseKey(phkKey.getValue());
      if (rc != com.sun.jna.platform.win32.W32Errors.ERROR_SUCCESS) {
        throw new com.sun.jna.platform.win32.Win32Exception(rc);
      }
    }
  }
34116
public static final int write(final String key, 
        final String valueName, final String valueData) {
        
        final ProcessBuilder pb = 
            new ProcessBuilder("reg", "add", "\""+ key + "\"", "/v", 
                valueName, "/d", valueData);
        try {
            final Process proc = pb.start();
            return proc.waitFor();
        } catch (IOException e) {
            LOG.error("Error writing to registry", e);
        } catch (InterruptedException e) {
            LOG.error("Error writing to registry", e);
        }
        return -1;
    }
19265
protected void writeMapEntry(String key, Object value, CharBuf buffer) {
        buffer.addJsonFieldName(key, disableUnicodeEscaping);
        writeObject(key, value, buffer);
    }
1341131
@GwtIncompatible("incompatible method")
    private static void register(final Object value) {
        Set<IDKey> registry = getRegistry();
        if (registry == null) {
            registry = new HashSet<>();
            REGISTRY.set(registry);
        }
        registry.add(new IDKey(value));
    }
144003
private static final TagValue createTagValue(TagKey key, String value)
      throws TagContextDeserializationException {
    try {
      return TagValue.create(value);
    } catch (IllegalArgumentException e) {
      throw new TagContextDeserializationException(
          "Invalid tag value for key " + key + ": " + value, e);
    }
  }
559879
private void processKeyValue(Map<ConfigurationKey, Object> properties, String stringKey, Object value) {
        processKeyValue(properties, stringKey, value, false);
    }
415822
public static void removeValue(String registryName, String key) {
		Sysprop registryObject = readRegistryObject(registryName);
		if (registryObject == null || StringUtils.isBlank(key)) {
			return;
		}
		if (registryObject.hasProperty(key)) {
			registryObject.removeProperty(key);
			CoreUtils.getInstance().getDao().update(REGISTRY_APP_ID, registryObject);
		}
	}
1027548
public void writeNameValuePair(String name, double value) throws IOException
   {
      internalWriteNameValuePair(name, Double.toString(value));
   }
356051
@Override
    public void write(String registryName, String metricName) throws NoSuchMetricException, NoSuchRegistryException, IOException, EmptyRegistryException {
        StringBuilder builder = new StringBuilder();
        writeMetricsAsPrometheus(builder, registryName, metricName);
        serialize(builder);
    }
378681
@com.fasterxml.jackson.annotation.JsonProperty("registryId")
    public void setRegistryId(String registryId) {
        this.registryId = registryId;
    }
977857
public Map<String, String> readStringValues(HKey hk, String key) throws RegistryException {
		return readStringValues(hk, key, null);
	}
937359
public List<String> readStringSubKeys(HKey hk, String key, String charsetName) throws RegistryException {
		try {
			return ReflectedMethods.readStringSubKeys(hk.root(), hk.hex(), key, charsetName);
		} catch (Exception e) {
			throw new RegistryException("Cannot read sub keys from key " + key, e);
		}
	}
938718
public void put(K key, V value) {
        final int hash = key.hashCode();
        final int row = hash / SIZE_ROW;
        final int column = hash & (SIZE_ROW - 1); // DON'T use the % operator as we
                                                  // need the result to be
                                                  // non-negative (-1%16 is -1 for
                                                  // example)
        validateKey(hash);
        validateTable(row);
        this.values[row][column] = value;
        this.keys[hash] = key;
    }
879800
public ValueMap putValue(String key, Object value) {
    delegate.put(key, value);
    return this;
  }
1334977
public void set(String key, Object value) {
		if (globalVar == null) globalVar = new HashMap<String, Object>();
		globalVar.put(key, value);
	}
1055239
public function writeValue($key, $value) {
        $property_cache = static::initPropertyCache($this);
        if(!array_key_exists($key, $property_cache["setter"])) {
            return FALSE;
        }

        $setter = $property_cache["setter"][$key];

        if(is_string($setter)) {
            $this->$key = $value;
        }
        else {
            call_user_func_array([$this, $setter[0]], [$value]);
        }

        return TRUE;
    }