ClassKey
A ServiceKey that uses the service's own KClass as its identifier.
This key kind is useful for the common case where you only need a single instance of a service and can identify it by its type alone, without needing to declare an explicit key instance.
All ClassKey implementations for the same service type T are considered equal. This allows, for example, a service to be registered with a LazyClassKey and later retrieved using a SingletonClassKey for the same type.
Warning on Type Erasure: Due to JVM type erasure, it is not advisable to use
ClassKeywith generic types (e.g.,List<String>). The key's identity is based on the erased type (Listin this case), meaningClassKey<List<String>>andClassKey<List<Int>>would be treated as the same key. For generic services, use explicit LazyKey or SingletonKey instances instead.