更新节点数据

@param name 节点名
@param data 要更新的数据
@return 节点原来的数据
770114
public T updateData(String name, T data) {
        Node<T> node = root.getNode(name);
        T old = null;
        if (node != null) {
            old = node.setData(data);
        }
        return old;
    }
866615
public void appendData(byte[] data) throws IOException, SymmetricKeyException {
        if (data == null)
            return;
        appendData(data, 0, data.length);
    }
1023758
public void cache(K name, V data) {

		if ( data == null){
			return;
		}
		if ( serializedCache != null){


			logger.debug("Caching {}  {}", name, data);

			serializedCache.put(name,data);


			// every 1000 objects we are writing to disk
			if ( serializedCache.keySet().size() % 1000 == 0 ) {

				flushCache();

			}

		}


	}
1047594
public function updateObjectState(
        ObjectStateUpdateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: sprintf('update-object-state-%d', $data->getObjectState()->id);

        return $this->formFactory->createNamed($name, ObjectStateUpdateType::class, $data);
    }
921793
public InventoryResultEntity withData(java.util.Map<String, InventoryResultItem> data) {
        setData(data);
        return this;
    }
1245406
@SuppressWarnings("unchecked")
	public T create(Map<String, Object> data)
	{
		Object[] args = new Object[arguments.length];
		for(int i=0, n=args.length; i<n; i++)
		{
			args[i] = arguments[i].getValue(data);
		}

		try
		{
			return (T) raw.newInstance(args);
		}
		catch(IllegalArgumentException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InstantiationException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(IllegalAccessException e)
		{
			throw new SerializationException("Unable to create; " + e.getMessage(), e);
		}
		catch(InvocationTargetException e)
		{
			throw new SerializationException("Unable to create; " + e.getCause().getMessage(), e.getCause());
		}
	}
369373
public static Payload create(CharSequence data) {
    return create(StandardCharsets.UTF_8.encode(CharBuffer.wrap(data)), null);
  }
1000515
public function overWriteParameter ($name, $data) {
		Request::OverWriteParameters($name, $data);
		$this->request->parameter->$name = $data;
		return true;
	}
562107
public static Part buildDataPart(final String name, final String data) {
		final ByteArrayContent content = new ByteArrayContent(null, data.getBytes());
		final Part part = new Part(content);
		final HttpHeaders headers = new HttpHeaders();
		final String disposition = String.format(Request.DATA_CONTENT_DISPOSITION, name);
		headers.set(Request.CONTENT_DISPOSITION, disposition);
		part.setHeaders(headers);
		return part;
	}
715213
public function set($name, array $data = [])
    {
        $this->setName($name);
        $this->setData($data);

        return $this->isValid();
    }
959076
public static function newInstance($name, $data = null)
  {
    if (!is_array($data)) {
      $data = array();
    }

    $config = self::getInstance($name);
    $config->_data = $data;

    return $config;
  }
419977
public function save($table_name, $data) {

            // Insert
            if (empty($data['id'])) {
                return $this->insert($table_name, $data);
            } // Update
            else {
                $id = $data['id'];
                unset($data['id']);

                return $this->update($table_name, $id, $data);
            }
        }
1124474
public Dataset updateDataset(String datasetName, String newDescription) {
    // [START bigquery_update_dataset_description]
    Dataset oldDataset = bigquery.getDataset(datasetName);
    DatasetInfo datasetInfo = oldDataset.toBuilder().setDescription(newDescription).build();
    Dataset newDataset = bigquery.update(datasetInfo);
    // [END bigquery_update_dataset_description]
    return newDataset;
  }
476043
public function overWritePostData ($name, $data) {
		Request::OverWritePostData($name, $data);
		$this->request->data->$name = $data;
		return true;
	}
524013
private function reloadConfig($name, $data = null, $json = false)
    {
        // get from DB
        if (empty($data)) {
            $this->config[$name] = $this->getConfigObjectFromDatabase($name);

            // set data from input
        } else {
            $this->config[$name] = $this->createConfigObject($name, $data, $json);
        }
    }
878473
public function saveConfig($name, $new_data)
    {
        try {
            //get original data from db
            $original_data = $this->app->db->getField('config', 'config_data', array('W' => "`config_name` = '" . $name . "'"));
            if (!empty($original_data))
                $original_data = json_array_decode($original_data);
            else {
                $original_data = array();
            }


            // update data
            foreach ($new_data as $key => $value) {
                $original_data[$key] = $value;
            }

            // convert back to json
            $new_data = array(
                'config_name' => $name,
                'config_data' => json_array_encode($original_data),
            );

            // save to db
            $this->app->db->save('config', $new_data, 'config_name', false);

            // Reload Data
            $this->reloadConfig($name, $new_data['config_data'], true);

        } catch (Exception $e) {
            throw $e;
        }
    }
448274
public void setData(byte[] data) {
        if (immutable) {
            throw new IllegalStateException(ERR_MSG_IMMUTABLE);
        }
        if (data == null) {
            this.data = null;
        } else {
            setData(data, 0, data.length);
        }
    }