AppserverIo\Appserver\Core\Api\Node\SystemPropertiesNodeTrait::setSystemProperty PHP Method

setSystemProperty() public method

Sets the system property with the passed name, type and value.
public setSystemProperty ( string $name, string $type, mixed $value ) : void
$name string The system property name
$type string The system property type
$value mixed The system property value
return void
    public function setSystemProperty($name, $type, $value)
    {
        // initialize the system property to set
        $sytemPropertyToSet = new SystemPropertyNode($name, $type, new NodeValue($value));
        // query whether a system property with this name has already been set
        foreach ($this->systemProperties as $key => $systemProperty) {
            if ($systemProperty->getName() === $systemProperty->getName()) {
                // override the system property
                $this->systemProperties[$key] = $sytemPropertyToSet;
                return;
            }
        }
        // append the system property
        $this->systemProperties[] = $sytemPropertyToSet;
    }