Class InjectionKey<T>
java.lang.Object
de.tomatengames.util.injector.InjectionKey<T>
- Type Parameters:
T- The type of the injection value associated with the key.
An InjectionKey can be used as injection key for an
InjectionProvider or for Injector.
That means an InjectionKey can be used for the methods AbstractInjectionProvider.provide(InjectionKey, Object)
and InjectionInjectable.inject(InjectionKey).
InjectionKeys are unique per object identity.
- Since:
- 1.9
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newInjectionKey.InjectionKey(@Nullable String name) Creates a newInjectionKey. -
Method Summary
-
Constructor Details
-
InjectionKey
Creates a newInjectionKey.- Parameters:
name- The display name of the key. If null, the key will be displayed as a number. InjectionKeys are unique per object identity. Different keys with equal names are handled as independent keys. The name is used by thetoString()method.
-
InjectionKey
public InjectionKey()Creates a newInjectionKey. The display name will be a number.
-
-
Method Details
-
equals
-
hashCode
-
toString
-