Sets the property on the given object to the new value

@param object on which to set the property
@param newValue the new value of the property
@throws RuntimeException if the property could not be set
2737
public void setProperty(final Object object, Object newValue) {
        AccessPermissionChecker.checkAccessPermission(field);
        final Object goalValue = DefaultTypeTransformation.castToType(newValue, field.getType());

        if (isFinal()) {
            throw new GroovyRuntimeException("Cannot set the property '" + name + "' because the backing field is final.");
        }
        try {
            field.set(object, goalValue);
        } catch (IllegalAccessException ex) {
            throw new GroovyRuntimeException("Cannot set the property '" + name + "'.", ex);
        }
    }
1338132
protected void setValue(int newValue, boolean updateTextField, boolean firePropertyChange) {
		int oldValue = value;
		if (newValue < min) {
			value = min;
		} else if (newValue > max) {
			value = max;
		} else {
			value = newValue;
		}

		if (updateTextField) {
			textField.setText(Integer.toString(value));
			textField.setForeground(Color.black);
		}

		if (firePropertyChange) {
			firePropertyChange("value", oldValue, value);
		}
	}
1303203
public void setProperty(String strKey, Object objValue)
    {
        if (m_mapParams == null)
            m_mapParams = new HashMap<String,Object>();
        m_mapParams.put(strKey, objValue);
    }
1013118
public void setObjectProperty(String objectType, String propertyType, String propertyValue) {
        logger.debug("objectType: " + objectType);
        logger.debug("propType: " + propertyType);
        logger.debug("property: " + propertyValue);

        if (objectType == null) {
            logger.error("Cannot add property for null object");
            return;
        }
        if (propertyType == null) {
            logger.error("Cannot add property for null property type");
            return;
        }
        if (propertyValue == null) {
            logger.warn("Will not add null property");
            return;
        }

        if (objectType.equals("Molecule")) {
            if (propertyType.equals("id")) {
                currentMolecule.setID(propertyValue);
            } else if (propertyType.equals("inchi")) {
                currentMolecule.setProperty("iupac.nist.chemical.identifier", propertyValue);
            }
        } else if (objectType.equals("PseudoAtom")) {
            if (propertyType.equals("label")) {
                if (!(currentAtom instanceof IPseudoAtom)) {
                    currentAtom = builder.newInstance(IPseudoAtom.class, currentAtom);
                }
                ((IPseudoAtom) currentAtom).setLabel(propertyValue);
            }
        } else if (objectType.equals("Atom")) {
            if (propertyType.equals("type")) {
                if (propertyValue.equals("R") && !(currentAtom instanceof IPseudoAtom)) {
                    currentAtom = builder.newInstance(IPseudoAtom.class, currentAtom);
                }
                currentAtom.setSymbol(propertyValue);
            } else if (propertyType.equals("x2")) {
                Point2d coord = currentAtom.getPoint2d();
                if (coord == null) coord = new Point2d();
                coord.x = Double.parseDouble(propertyValue);
                currentAtom.setPoint2d(coord);
            } else if (propertyType.equals("y2")) {
                Point2d coord = currentAtom.getPoint2d();
                if (coord == null) coord = new Point2d();
                coord.y = Double.parseDouble(propertyValue);
                currentAtom.setPoint2d(coord);
            } else if (propertyType.equals("x3")) {
                Point3d coord = currentAtom.getPoint3d();
                if (coord == null) coord = new Point3d();
                coord.x = Double.parseDouble(propertyValue);
                currentAtom.setPoint3d(coord);
            } else if (propertyType.equals("y3")) {
                Point3d coord = currentAtom.getPoint3d();
                if (coord == null) coord = new Point3d();
                coord.y = Double.parseDouble(propertyValue);
                currentAtom.setPoint3d(coord);
            } else if (propertyType.equals("z3")) {
                Point3d coord = currentAtom.getPoint3d();
                if (coord == null) coord = new Point3d();
                coord.z = Double.parseDouble(propertyValue);
                currentAtom.setPoint3d(coord);
            } else if (propertyType.equals("xFract")) {
                Point3d coord = currentAtom.getFractionalPoint3d();
                if (coord == null) coord = new Point3d();
                coord.x = Double.parseDouble(propertyValue);
                currentAtom.setFractionalPoint3d(coord);
            } else if (propertyType.equals("yFract")) {
                Point3d coord = currentAtom.getFractionalPoint3d();
                if (coord == null) coord = new Point3d();
                coord.y = Double.parseDouble(propertyValue);
                currentAtom.setFractionalPoint3d(coord);
            } else if (propertyType.equals("zFract")) {
                Point3d coord = currentAtom.getFractionalPoint3d();
                if (coord == null) coord = new Point3d();
                coord.z = Double.parseDouble(propertyValue);
                currentAtom.setFractionalPoint3d(coord);
            } else if (propertyType.equals("formalCharge")) {
                currentAtom.setFormalCharge(Integer.parseInt(propertyValue));
            } else if (propertyType.equals("charge") || propertyType.equals("partialCharge")) {
                currentAtom.setCharge(Double.parseDouble(propertyValue));
            } else if (propertyType.equals("hydrogenCount")) {
                currentAtom.setImplicitHydrogenCount(Integer.parseInt(propertyValue));
            } else if (propertyType.equals("dictRef")) {
                currentAtom.setProperty("org.openscience.cdk.dict", propertyValue);
            } else if (propertyType.equals("atomicNumber")) {
                currentAtom.setAtomicNumber(Integer.parseInt(propertyValue));
            } else if (propertyType.equals("massNumber")) {
                currentAtom.setMassNumber((int) Double.parseDouble(propertyValue));
            } else if (propertyType.equals("id")) {
                logger.debug("id: ", propertyValue);
                currentAtom.setID(propertyValue);
                atomEnumeration.put(propertyValue, numberOfAtoms);
            }
        } else if (objectType.equals("Bond")) {
            if (propertyType.equals("atom1")) {
                bond_a1 = Integer.parseInt(propertyValue);
            } else if (propertyType.equals("atom2")) {
                bond_a2 = Integer.parseInt(propertyValue);
            } else if (propertyType.equals("id")) {
                logger.debug("id: " + propertyValue);
                bond_id = propertyValue;
            } else if (propertyType.equals("order")) {
                try {
                    Double order = Double.parseDouble(propertyValue);
                    if (order == 1.0) {
                        bond_order = IBond.Order.SINGLE;
                    } else if (order == 2.0) {
                        bond_order = IBond.Order.DOUBLE;
                    } else if (order == 3.0) {
                        bond_order = IBond.Order.TRIPLE;
                    } else if (order == 4.0) {
                        bond_order = IBond.Order.QUADRUPLE;
                    } else {
                        bond_order = IBond.Order.SINGLE;
                    }
                } catch (Exception e) {
                    logger.error("Cannot convert to double: " + propertyValue);
                    bond_order = IBond.Order.SINGLE;
                }
            } else if (propertyType.equals("stereo")) {
                if (propertyValue.equals("H")) {
                    bond_stereo = IBond.Stereo.DOWN;
                } else if (propertyValue.equals("W")) {
                    bond_stereo = IBond.Stereo.UP;
                }
            }
        }
        logger.debug("Object property set...");
    }
702823
public void setAttribute(Object object, String attribute, Object newValue) {
        delegate.setAttribute(object, attribute, newValue);
    }
615366
public void setValueOff(String newValue, @Nullable String newName) {
            if (!isChecked()) { // refining on valueOff: facetRefinement needs an update
                searcher.updateFacetRefinement(attribute, valueOff, false)
                        .updateFacetRefinement(newName != null ? newName : attribute, newValue, true)
                        .search();
            }
        this.valueOff = newValue;
        applyEventualNewAttribute(newName);
    }
1135402
public void setValue(byte[] newValue) throws Exception
    {
        Preconditions.checkState(state.get() == State.STARTED, "not started");

        Stat result = client.setData().forPath(path, newValue);
        updateValue(result.getVersion(), Arrays.copyOf(newValue, newValue.length));
    }
477505
function (newValue) {
                    // and no inheritance is involved
                    if (this === self) {
                      // notify the method but ...
                      var value = oldValue;
                      updateValue(newValue);
                      // ... do not update the get value
                      oldValue = value;
                    } else {
                      // with inheritance, simply set the property
                      // as if it was a regular assignment operation
                      setValue(this, prop, newValue);
                    }
                  }
881457
public void write(Object object, Object value) {
        if(object == null) {
            String msg = "Can not update the identifier \"" + _identifier + "\" on a null value object.";
            LOGGER.error(msg);
            throw new RuntimeException(msg);
        }

        if(TRACE_ENABLED)
            LOGGER.trace("Update property named \"" + _identifier + "\" on object of type: \"" + object.getClass().getName() + "\"");

        if(object instanceof Map)
            mapUpdate((Map)object, _identifier, value);
        else if(object instanceof List) {
            int i = parseIndex(_identifier);
            listUpdate((List)object, i, value);
        }
        else if(object.getClass().isArray()) {
            int i = parseIndex(_identifier);
            arrayUpdate(object, i, value);
        }
        else beanUpdate(object, _identifier, value);
    }
481661
public void setPropertyValue(final JsiiObjectRef objRef, final String property, final JsonNode value) {
        ObjectNode req = makeRequest("set", objRef);
        req.put("property", property);
        req.set("value", value);

        this.runtime.requestResponse(req);
    }
1117306
public void setNewVertexValue(VV newValue) {
		if (setNewVertexValueCalled) {
			throw new IllegalStateException("setNewVertexValue should only be called at most once per updateVertex");
		}
		setNewVertexValueCalled = true;
		if (isOptDegrees()) {
			outValWithDegrees.f1.f0 = newValue;
			outWithDegrees.collect(outValWithDegrees);
		} else {
			outVal.setValue(newValue);
			out.collect(outVal);
		}
	}
342190
private static void setSimpleValue(Object obj, Property property, Object value) {
        if (property == null) {
            throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyName.");
        }

        property.set(obj, value);
    }
433233
public static void setPropertyValue(BeanDefinitionBuilder builder, String propertyValue, String propertyName) {
        if (StringUtils.hasText(propertyValue)) {
            builder.addPropertyValue(propertyName, propertyValue);
        }
    }
517665
public void setValueFromObject(Object valueAsJava) {
 	if ((valueAsJava!=null) && (value==null)) {
 	    if (valueAsJava instanceof QualifiedName) { 
 		this.value=valueAsJava;
 	    } else if (valueAsJava instanceof LangString) { 
 		this.value=valueAsJava;
 	    } else if (valueAsJava instanceof byte[]) {
 		setValueAsJava((byte[]) valueAsJava);
 	    } else if (valueAsJava instanceof org.w3c.dom.Node) {
 		setValueAsJava((org.w3c.dom.Node)valueAsJava);
 	    } else {
 		this.value = valueAsJava.toString();
 	    }
 	}
1221639
protected void setInternalValue(String newValue, boolean repaintIsNotNeeded) {
        super.setInternalValue(newValue);
        extension.setSignature(newValue, changingVariables || repaintIsNotNeeded);
    }
47973
public function setProperty(&$object, $propertyName, $propertyValue)
    {
        $property = $this->getPropertyInstance($object, $propertyName);
        $property->setAccessible(true);
        $property->setValue($object, $propertyValue);
    }
492390
private static <T> void  setIfNew(Property<T> prop, T newValue)
  {
    if(!Objects.equals(prop.getValue(), newValue))
    {
      prop.setValue(newValue);
    }
  }