Update metaData element if it exists or add it otherwise

@param target
@return true on update of existing element false on added of element
975906
public boolean updateMetadata(final RuleMetadata target) {

        RuleMetadata metaData = getMetaData(target.getAttributeName());
        if (metaData != null) {
            metaData.setValue(target.getValue());
            return true;
        }

        addMetadata(target);
        return false;
    }
662022
void apply(UpdateableSegmentMetadata target) {
        if (!this.isChanged) {
            // No changes made.
            return;
        }

        Preconditions.checkArgument(target.getId() == this.id,
                "Target Segment Id mismatch. Expected %s, given %s.", this.id, target.getId());
        Preconditions.checkArgument(target.getName().equals(this.name),
                "Target Segment Name mismatch. Expected %s, given %s.", name, target.getName());

        // Apply to base metadata.
        target.setLastUsed(this.lastUsed);
        target.updateAttributes(this.attributeUpdates);
        target.setLength(this.length);

        // Update StartOffset after (potentially) updating the length, since he Start Offset must be less than or equal to Length.
        target.setStartOffset(this.startOffset);
        if (this.storageLength >= 0) {
            // Only update this if it really was set. Otherwise we might revert back to an old value if the Writer
            // has already made progress on it.
            target.setStorageLength(this.storageLength);
        }

        if (this.sealed) {
            target.markSealed();
            if (this.sealedInStorage) {
                target.markSealedInStorage();
            }
        }

        if (this.merged) {
            target.markMerged();
        }

        if (this.deleted) {
            target.markDeleted();
            if (this.deletedInStorage) {
                target.markDeletedInStorage();
            }
        }

        if (this.pinned) {
            target.markPinned();
        }
    }
376967
@Override
    public final void setMetadataProperty(final String key, final String value) {
        _metadataProperties.put(key, value);
    }
167531
public void setTarget(Profile<S, C> target) {
		this.target = target;
		targetFuture = null;
		reset();
	}
966322
@Override
    public void setTarget(String target) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            SibTr.debug(this, TRACE, "setTarget", target);
        }
        _target = target;

    }
872519
@Override
    public void setTarget(Object target) {
        if (mTarget != target) {
            final Object oldTarget = mTarget;
            mTarget = target;
            if (oldTarget != null && target != null && oldTarget.getClass() == target.getClass()) {
                return;
            }
            // New target type should cause re-initialization prior to starting
            mInitialized = false;
        }
    }
1127148
public void setEditorTarget (PropertyEditorTarget target)
    {
        if (target instanceof DBMetaSchemaNode)
        {
            super.setEditorTarget(target);
            this.tfSchemaName.setText((String)target.getAttribute(DBMetaSchemaNode.ATT_SCHEMA_NAME));
        }
        else
        {
            throw new UnsupportedOperationException("This editor can only edit DBSchemaCatalogNode objects");
        }
    }
1293284
function (target, name, meta){
            var _ctor = __define.fixTargetCtor(target),
                _key = __define.fixTargetKey(name),
                _exist = _key in _ctor,
                _descriptor = {};
            var _getter, _setter;

            if ('value' in meta) {
                var _value = meta.value,
                    _field = '_' + name,
                    _get = meta.get,
                    _set = meta.set;

                _getter = _get || function () {
                    if (_field in this) {
                        return this[_field];
                    }
                    else {
                        return zn.is(_value, 'function') ? _value.call(this) : _value;
                    }
                };
                _setter = meta.readonly ?
                    function (value, options) {
                        if (options && options.force) {
                            this[_field] = value;
                        }
                        else {
                            return false;
                        }
                    } :
                    (_set ||function (value) {
                        this[_field] = value;
                    });
            } else {
                _getter = meta.get || function () {
                    return undefined;
                };
                _setter = meta.set || function () {
                    return false;
                };
            }

            if (_exist) {
                _getter.__super__ = _ctor[_key].getter;
                _setter.__super__ = _ctor[_key].setter;
            }

            /*
            if(!_exist){
                _descriptor = Object.defineProperty(target, name, {
                    get: _getter,
                    set: _setter,
                    configurable : true
                });
            }*/


            _descriptor = Object.defineProperty(target, name, {
                get: _getter,
                set: _setter,
                configurable : true
            });

            _ctor[_key] = {
                name: name,
                type: 'property',
                meta: meta,
                getter: _getter,
                setter: _setter,
                descriptor: _descriptor
            };

            return _exist;
        }
246161
protected Map<String, Object> updateMap(Map<String, Object> target, Map<String, Object> source) {
        Map<String, Object> resultMap = new HashMap<String, Object>(target);

        String keyWOClassName = null;

        for (String sourceKey : source.keySet()) {
            keyWOClassName = InputUtils.removeClassName(sourceKey);

            if (target.containsKey(sourceKey) == true) {
                resultMap.put(sourceKey, source.get(sourceKey));
            } else if (target.containsKey(keyWOClassName) == true) {
                resultMap.put(keyWOClassName, source.get(keyWOClassName));
            }
        }

        return resultMap;
    }
917489
function (target) {
        var element = this.hashForMethods[target.id]
        if (element) {
            element.paused = false
        }

        var elementUpdate = this.hashForUpdates[target.id]
        //console.log('foo', target.id, elementUpdate)
        if (elementUpdate) {
            elementUpdate.paused = false
        }
    }
90319
public static void updateMetadata(CacheEntry entry, Metadata providedMetadata) {
      if (entry != null && providedMetadata != null) {
         Metadata mergedMetadata;
         if (entry.getMetadata() == null) {
            mergedMetadata = providedMetadata;
         } else {
            mergedMetadata = applyVersion(entry.getMetadata(), providedMetadata);
         }
         entry.setMetadata(mergedMetadata);
      }
   }
157360
public void addMappingTarget(String mapping, RequestProcessor target) throws Exception {
        this.requestMapper.addMapping(mapping, target);
    }
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);
        }
    }
668376
protected void updateResource(Resource value, String xmlTag, Counter counter, Element element)
   {
      Element root = element;
      Counter innerCount = new Counter(counter.getDepth() + 1);
      findAndReplaceSimpleElement(innerCount, root, "targetPath", value.getTargetPath(), null);
      findAndReplaceSimpleElement(innerCount, root, "filtering",
               (value.isFiltering() == false) ? null : String.valueOf(value.isFiltering()), "false");
      findAndReplaceSimpleElement(innerCount, root, "directory", value.getDirectory(), null);
      findAndReplaceSimpleLists(innerCount, root, value.getIncludes(), "includes", "include");
      findAndReplaceSimpleLists(innerCount, root, value.getExcludes(), "excludes", "exclude");
   }
636000
public synchronized void update(final TargetInfo linkTarget) {
    final File outputFile = linkTarget.getOutput();
    final String outputName = outputFile.getName();
    //
    // if output file doesn't exist or predates the start of the
    // compile or link step (most likely a compilation error) then
    // do not write add a history entry
    //
    if (outputFile.exists() && !CUtil.isSignificantlyBefore(outputFile.lastModified(), this.historyFile.lastModified())) {
      this.dirty = true;
      this.history.remove(outputName);
      final SourceHistory[] sourceHistories = linkTarget.getSourceHistories(this.outputDirPath);
      final TargetHistory newHistory = new TargetHistory(linkTarget.getConfiguration().getIdentifier(), outputName,
          outputFile.lastModified(), sourceHistories);
      this.history.put(outputName, newHistory);
    }
  }
498751
public void setEditorTarget (PropertyEditorTarget target)
    {
        if (target instanceof DBMetaCatalogNode)
        {
            super.setEditorTarget(target);
            this.tfCatalogName.setText((String)target.getAttribute(DBMetaCatalogNode.ATT_CATALOG_NAME));
        }
        else
        {
            throw new UnsupportedOperationException("This editor can only edit DBMetaCatalogNode objects");
        }
    }
759645
public Object get(Object target) throws MetadataException
    {
        Object result = target;
        if (isNestedField())
        {
            List fields = getFieldsList();
            for (int i = 0; i < fields.size(); i++)
            {
                if (result == null) break;
                result = getValueFrom((Field) fields.get(i), result);
            }
        }
        else
        {
            result = result != null ? getValueFrom(getField(), result) : null;
        }
        return result;
    }