final public static function valueOf($name) : self
    {
        $className = static::class;
        Preconditions::checkArgument(
            array_key_exists($className, self::$cache) && array_key_exists($name, self::$cache[$className]),
            "The enum '%s' type has no constant with name '%s'",
            $className,
            $name
        );
        return self::$cache[$className][$name];
    }