final public static function fromName(string $name): Enum
    {
        $constName = sprintf('%s::%s', static::class, $name);

        if (!defined($constName)) {
            $message = sprintf('%s is not a member constant of enum %s', $name, static::class);
            throw new DomainException($message);
        }

        return new static(constant($constName));
    }