static function FromString($json)
    {
        $jsonObj = @\json_decode($json);
        if (!is_a($jsonObj, 'stdClass')) {
            return null; 
        }
        $result = new static();
        $class = new \ReflectionClass($result);
        $props = $class->getProperties(\ReflectionProperty::IS_PUBLIC & ~ \ReflectionProperty::IS_STATIC);
        foreach ($props as $prop) {
            $name = $prop->getName();
            if (isset($jsonObj->$name)) {
                $prop->setValue($result, $jsonObj->$name);
            }
        }
        return $result;
    }