Stores an item in local storage.

@param api the storage interface.
@param id the storage ID to use.
@param key the key for the item.
@param data the data for the item (any javascript object/primitive).
12085
function(api, id, key, data) {
  // get storage object
  var obj = _getStorageObject(api, id);
  if(obj === null) {
    // create a new storage object
    obj = {};
  }
  // update key
  obj[key] = data;

  // set storage object
  _setStorageObject(api, id, obj);
}
1053532
public void addData(String key, String value) throws InvalidPackageRevisionDataException {
        validateDataKey(key);
        data.put(key, value);
    }
1205626
function(api, id) {
  if(!api) {
    throw new Error('WebStorage not available.');
  }

  // get the existing entry
  var rval = api.getItem(id);

  /* Note: We check api.init because we can't do (api == localStorage)
    on IE because of "Class doesn't support Automation" exception. Only
    the flash api has an init method so this works too, but we need a
    better solution in the future. */

  // flash returns item wrapped in an object, handle special case
  if(api.init) {
    if(rval.rval === null) {
      if(rval.error) {
        throw rval.error;
      }
      // no error, but also no item
      rval = null;
    } else {
      rval = rval.rval;
    }
  }

  // handle decoding
  if(rval !== null) {
    // base64-decode and json-decode data
    rval = JSON.parse(util.decode64(rval));
  }

  return rval;
}
346561
function(key) {
            var s = Storage.storage();
            if (s == null) {
                return null;
            }
            if (_.isUndefined(s[key]) == false) {
                try {
                    return JSON.parse(s[key]);
                } catch(err) {
                    logging.error("Error parsing ", s[key], err);
                    return s[key];
                }
                
            } else {
                return null;
            }
        }
1176493
@Override
    public void put(String key, JSONObject value) throws KeeperException, InterruptedException {
        try {
            m_zk.create(ZKUtil.joinZKPath(m_rootNode, key), value.toString().getBytes(Constants.UTF8ENCODING),
                    Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
        } catch (KeeperException.NodeExistsException e) {
            m_zk.setData(ZKUtil.joinZKPath(m_rootNode, key), value.toString().getBytes(Constants.UTF8ENCODING), -1);
        }
    }
1247924
synchronized void put(int key, CachedObject row) {

        int storageSize = row.getStorageSize();

        if (size() >= capacity
                || storageSize + cacheBytesLength > bytesCapacity) {
            cleanUp();
        }

        if (accessCount == Integer.MAX_VALUE) {
            super.resetAccessCount();
        }

        super.addOrRemove(key, row, false);
        row.setInMemory(true);

        cacheBytesLength += storageSize;
    }
104
public void setData(String key, String value) {
        QName qn = new QName("data-" + key);
        this.getOtherAttributes().put(qn, value);
    }
435465
@Override
    public void store(T key, INDArray object) {
        INDArray toStore;
        if (useInplaceCompression) {
            compressor.compressi(object);
            toStore = object;
        } else {
            toStore = compressor.compress(object);
        }

        if (emulateIsAbsent)
            lock.writeLock().lock();

        compressedEntries.put(key, toStore);

        if (emulateIsAbsent)
            lock.writeLock().unlock();
    }
499075
@Override
    public void store(String key, byte[] payload) throws IOException {
        try {
            Cipher sym = Cipher.getInstance("AES");
            sym.init(Cipher.ENCRYPT_MODE, masterKey);
            try (
                    FileOutputStream fos = new FileOutputStream(getFileFor(key));
                    CipherOutputStream cos = new CipherOutputStream(fos, sym)
            ) {
                cos.write(payload);
                cos.write(MAGIC);
            }
        } catch (GeneralSecurityException e) {
            throw new IOException("Failed to persist the key: " + key, e);
        }
    }
1286259
public void put(String id, Object value) {

    Object old = this.id2valueMap.put(id, value);
    if ((old != null) && (old != value)) {
      this.duplicateIdErrors.add(this.bundle.errorDuplicateObjectWithKey(value, id));
    }
  }
1111223
function(key, object) {

          // Convert object to JSON and store in localStorage
          var json = JSON.stringify(object);
          persistenceStrategy.set(key, json);

          // Then store it in the object cache
          objectCache[key] = object;
        }
298474
function store(key, info) {
        var items = nodes[key];
        if (!items) {
            items = nodes[key] = [];
        }
        items.push(info);
    }
916383
@Override
	public void setData(final byte[] data, final int offset)
	{
		if (offset < 0 || offset > data.length)
			throw new KNXIllegalArgumentException("illegal offset " + offset);
		toDPT(data, offset);
	}
607649
public void setFileMetadata(String file, String key, Object val) {
    throwIfImmutable();
    Map<String, Object> fileKeys = fileLevel.get(file);
    if (fileKeys == null) {
      fileKeys = new ConcurrentHashMap<>();
      fileLevel.put(file, fileKeys);
    }

    fileKeys.put(key, val);
    cachedId = null;
  }
908716
public void setId(String id)
	{
		if (id == null || id.length() == 0)
			throw new IllegalArgumentException(
			"id required in setId");

		this.setId(Integer.valueOf(id));
	}
1169713
public function store($id, $data = array())
    {
        try {

            if (empty($id)) {
                throw new StorageException('Invalid id parameter.');
            }
            $this->persistence = $this->getPersistence();

            $data = $this->cleanInputData($data);
            if (!$this->exists($id)) {
                $this->insert($id, $data);
            } else {
                $this->update($id, $data);
            }
            return true;

        } catch (\PDOException $e) {
            throw new StorageException($e->getMessage());
        }
    }
1047454
function remove(key) {
           if (!isReserved(key)) {
             if (typeof data[key] !== "undefined") {
               delete data[key];

               if (me.device.localStorage === true) {
                 localStorage.removeItem("me.save." + key);
                 localStorage.setItem("me.save", JSON.stringify(Object.keys(data)));
               }
             }
           }
         }