public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH): string
    {
        if (!$name instanceof Content && !$name instanceof ContentInfo) {
            throw new RouteNotFoundException('Could not match route');
        }

        if (empty($name->mainLocationId)) {
            throw new LogicException('Cannot generate an UrlAlias route for content without main location.');
        }

        return $this->generator->generate(
            $name->mainLocation->innerLocation,
            $parameters,
            $referenceType
        );
    }