public function isPath(string $path, bool $isRegex = false) : bool
    {
        if ($isRegex) {
            return preg_match('#^' . $path . '$#', $this->path) === 1;
        } else {
            return $this->path == $path;
        }
    }