Set the record metadata
@param key key for the metadata
@param value value of the metadata

@implNote should not be called concurrently
766537
public void setRecordMetadata(String key, Object value) {
    if (_recordMetadata == null) {
      _recordMetadata = new HashMap<>();
    }

    _recordMetadata.put(key, value);
  }
757874
public void set(String key, Object value) {
    if (!StringUtil.isEmpty(key) && null != value) {
      pendingInstanceData.put(key, value);
    }
  }
636063
@Override
    public void set(String key, Object value, int expiration) {
        Element element = new Element(key, value);
        if (expiration == 0) {
            element.setEternal(true);
        }
        element.setTimeToLive(expiration);
        cache.put(element);
    }
584929
public synchronized void setProperty(PropertyKey key, Object value)
    {
        if (!isValidKey(key))
            throw new IllegalArgumentException("Key " + key + " is not valid for " + getMapClass());

        //
        // Validate the value argument, based upon the property type reference by the key
        //
        Class propType = key.getPropertyType();
        if (value == null)
        {
            if (propType.isPrimitive() || propType.isAnnotation())
                throw new IllegalArgumentException("Invalid null value for key " + key);
        }
        else
        {
            if (propType.isPrimitive())
                propType = (Class)_primToObject.get(propType);

            if (!propType.isAssignableFrom(value.getClass()))
            {
                throw new IllegalArgumentException("Value class (" + value.getClass() + 
                                                   ") not of expected type: " + propType);
            }
        }
        _properties.put(key, value);
        _propertySets.add(key.getPropertySet());
    }
131672
public void add(final String key, final String value)
	{
		data.setProperty(key, value);
		fireTableDataChanged();
	}
327082
public static void populateMetadata(AbstractComputeInstanceMetadata instanceMetadata, Map<?, ?> metadata) {
        if (metadata != null) {
            Map<String, String> finalMetadata = new HashMap<>(metadata.size());
            for (Map.Entry<?, ?> entry : metadata.entrySet()) {
                Object key = entry.getKey();
                Object value = entry.getValue();
                if (value instanceof String) {
                    finalMetadata.put(key.toString(), value.toString());
                }
            }
            instanceMetadata.setMetadata(finalMetadata);
        }
    }
1133429
public void setIntProperty(String key, int value)
  {
    m_properties.put(key, Integer.toString(value));
  }
68390
private void setFromMetadata(Metadata md) {
        // TODO: add pom.properties support?
        String vendorkey = Attributes.Name.IMPLEMENTATION_VENDOR.toString();
        String versionkey = Attributes.Name.IMPLEMENTATION_VERSION.toString();
        String namekey = Attributes.Name.IMPLEMENTATION_TITLE.toString();
        if (this.vendor.equals(UNKNOWN) && md.containsKey(vendorkey)) {
            this.vendor = md.get(vendorkey);
        }
        if (this.version.equals(UNKNOWN) && md.containsKey(versionkey)) {
            this.version = md.get(versionkey);
        }
        if (this.name.equals(UNKNOWN) && md.containsKey(namekey)) {
            this.name = md.get(namekey);
        }
    }
88920
public Object setMetadata(ITree node, String key, Object value) {
        if (node == null)
            return setMetadata(key, value);
        else {
            Object res = node.setMetadata(key, value);
            if (res == null)
                return getMetadata(key);
            return res;
        }
    }
915003
public void setProperty(String key, String value) {
        assertArgumentNotNull("key", key);
        assertArgumentNotNull("value", value);
        session.getProperties().setProperty(key, value);
    }
1295583
public void set(Object target, Object value) throws MetadataException
    {
        // if target null, we have nothing to do
        if(target == null) return;
        Object current = target;
        if (isNestedField())
        {
            List fields = getFieldsList();
            int size = fields.size() - 1;
            Field field;
            for (int i = 0; i < size; i++)
            {
                field = (Field) fields.get(i);
                Object attribute;
                try
                {
                    attribute = getValueFrom(field, current);
                }
                catch (Exception e)
                {
                    throw new MetadataException("Can't read field '" + field.getName() + "' of type " + field.getType().getName(), e);
                }
                if (attribute != null || value != null)
                {
                    // if the intermediary nested object is null, we have to create
                    // a new instance to set the value
                    if (attribute == null)
                    {
                        try
                        {
                            attribute = ClassHelper.newInstance(field.getType());
                        }
                        catch (Exception e)
                        {
                            throw new MetadataException("Can't create nested object of type '"
                                    + field.getType() + "' for field '"
                                    + field.getName() + "'", e);
                        }
                    }
                    try
                    {
                        //field.set(current, attribute);
                        setValueFor(field, current, attribute);
                    }
                    //catch (IllegalAccessException e)
                    catch (Exception e)
                    {
                        throw new MetadataException("Can't set nested object of type '"
                                    + field.getType() + "' for field '"
                                    + field.getName() + "'", e);
                    }
                }
                else
                {
                    return;
                }
                current = attribute;
            }
        }
        setValueFor(getField(), current, value);
    }
346759
public FileIndexBuilder putMetadata(String key, String value) {
        checkIfDestroyed();
        metadata.put(key, value);
        return this;
    }
447800
@Override
  public void addUserMetadata(String key, String value)
  {
    this.s3Metadata.addUserMetadata(key, value);
  }
598050
public void set(EditLogLedgerMetadata metadata) {
    logVersion = metadata.getLogVersion();
    ledgerId = metadata.getLedgerId();
    firstTxId = metadata.getFirstTxId();
    lastTxId = metadata.getLastTxId();
  }
219296
public Object putNodeMetaData(Object key, Object value) {
        if (key == null) throw new GroovyBugError("Tried to set meta data with null key on " + this + ".");
        if (metaDataMap == null) {
            metaDataMap = new ListHashMap();
        }
        return metaDataMap.put(key, value);
    }
889499
public function addMeta(string $key, $value): void
	{
		Arr::set($this->meta, $key, $value);
	}
1106538
public function putMetaData($key, $value = null): void
    {
        $meta = $this->getAttribute('meta');

        if (\is_array($key)) {
            foreach ($key as $name => $value) {
                $meta->put($name, $value);
            }
        } else {
            $meta->put($key, $value);
        }

        $this->setMetaAttribute($meta);
    }