Requests that the specified attribute be changed to the specified value. Normally the
generated setter methods should be used but in rare cases a caller may wish to update
distributed fields in a generic manner.
966967
public void changeAttribute (String name, Object value)
    {
        Accessor acc = getAccessor(name);
        requestAttributeChange(name, value, acc.get(this));
        acc.set(this, value);
    }
728542
def update_field(self, name, value):
        
        kwargs = {}
        kwargs['field.' + name] = value
        return self.post(**kwargs)
1134567
public void set(String name, Object obj) throws IOException {
        if (!(obj instanceof Integer)) {
            throw new IOException("Attribute must be of type Integer.");
        }
        if (name.equalsIgnoreCase(REASON)) {
            reasonCode = ((Integer)obj).intValue();
        } else {
            throw new IOException
                ("Name not supported by CRLReasonCodeExtension");
        }
        encodeThis();
    }
131128
def attribute_change(attr)
      attr = database_field_name(attr)
      [changed_attributes[attr], attributes[attr]] if attribute_changed?(attr)
    end
1218399
def _set(self, name, value):
        
        if value is not UNSET:
            if isinstance(value, Slotted):
                current = getattr(self, name, UNSET)
                if current is None or current is UNSET:
                    current = value.__class__()
                    current.set(value)
                    setattr(self, name, current)
                    return
                if isinstance(current, Slotted):
                    current.set(value)
                    return
            setattr(self, name, value)
1235817
private void changeSimpleValue(String attributeName, int index, String value, List<String> parentPathElements) {

        CmsAttributeHandler handler = getAttributeHandler(attributeName, parentPathElements);
        handler.changeValue(value, index);
    }
990650
def set(self, name, value):
        
        attr = self.getAttribute(name)
        if attr is None:
            attr = Attribute(name, value)
            self.append(attr)
        else:
            attr.setValue(value)
303298
def updateCurrentValue(self, value):
        
        try:
            method = getattr(self._targetObject, self._setter)
        except AttributeError:
            return
        
        try:
            method(unwrapVariant(value))
        except:
            return
434607
def set(self, key_or_attrs, value=None, unset=False):
        
        if isinstance(key_or_attrs, dict) and value is None:
            attrs = key_or_attrs
            keys = attrs.keys()
            for k in keys:
                if isinstance(attrs[k], LocalProxy):
                    attrs[k] = attrs[k]._get_current_object()
        else:
            key = key_or_attrs
            if isinstance(value, LocalProxy):
                value = value._get_current_object()
            attrs = {key: utils.decode(key, value)}

        if unset:
            for k in attrs.keys():
                attrs[k] = operation.Unset()

        self.validate(attrs)

        self._merge_metadata(attrs)

        keys = list(attrs.keys())
        for k in keys:
            v = attrs[k]
            # TODO: Relation

            if not isinstance(v, operation.BaseOp):
                v = operation.Set(v)

            self._attributes[k] = v._apply(self._attributes.get(k), self, k)
            if self._attributes[k] == operation._UNSET:
                del self._attributes[k]
            self._changes[k] = v._merge(self._changes.get(k))

        return self
1094272
def set_value(self, value):
        
        self._value = value
        setattr(self.target, self._name, value)
1170104
def set_field(self, name, value):
        """"""
        f = getattr(self, name, None)
        if isinstance(f, DataField):
            f.set(self, value)
        else:
            raise FieldError("No field named '%s'" % name)
502779
def update_attr(self, attr):
        
        changed_attr = []
        for key, value in attr.items():
            if value is None:
                continue
            if getattr(self, "_{0}".format(key), None) != value:
                changed_attr.append(key)
                self.__setattr__("_{0}".format(key), value)
                _LOGGER.debug('%s: update %s with %s', self.name, key, value)
        return changed_attr
1276338
public BaseBo setAttribute(String attrName, Object value, boolean triggerChange) {
        Lock lock = lockForWrite();
        try {
            if (value == null) {
                attributes.remove(attrName);
            } else {
                attributes.put(attrName, value);
            }
            if (triggerChange) {
                triggerChange(attrName);
            }
            markDirty();
            return this;
        } finally {
            lock.unlock();
        }
    }
1187754
def update_attribute(key, value)
      unless attribute?(key.to_sym)
        raise Error::UnknownAttribute.new(attribute: key)
      end

      _attributes[key.to_sym] = value
    end
577516
def modify(self, **kwargs):
        """"""
        for key, val in kwargs.items():
            setattr(self, key, val)
        return self
352639
function setAttr(setModel, newValue, setOptions) {
      var oldValue = model._containedModels[attrName];

      // Pass through if removing
      if (newValue === undefined || newValue === null) {
        model._containedModels[attrName] = newValue;
        return;
      }

      // Is the new value the correct type?
      if (newValue instanceof Ctor) {

        // Directly set if no old value
        if (!oldValue instanceof Ctor) {
          model._containedModels[attrName] = newValue;
          return;
        }

        // They're both models.  Disregard if they're the same.
        var oldJSON = oldValue.toJSON({deep:true});
        var newJSON = newValue.toJSON({deep:true});
        if (_.isEqual(oldJSON, newJSON)) {
          return;
        }

        // Merge the raw JSON if they're both models
        newValue = newJSON;
      }

      // Keep the previous model and merge new data into it
      // For collections this relies on the Collection.set() method
      if (oldValue instanceof Ctor) {
        model.attributes[attrName] = oldValue;
        model._currentAttributes[attrName] = oldValue;
        model.changed[attrName] = oldValue;
        oldValue.set(newValue, setOptions);
        return;
      }

      // Create a new model or collection, passing the value
      newValue =
        model._containedModels[attrName] =
        model.attributes[attrName] =
        model._currentAttributes[attrName] =
        new Ctor(newValue, setOptions);

      // Watch for changes to the underlying model or collection
      // (collection add/remove), forwarding changes to this model
      newValue.on('change add remove reset', UI.onSubModelChange, {
        parent:model,
        attrName: attrName
      });
    }
217788
public void setAttribute(String name, Object value) {
        createSessionIfNecessary();
        synchronized (this) {
            adaptee.setAttribute(name, value);
        }
    }