Class ConstructWireProvider<F>
java.lang.Object
dev.wyck.factory.WireProvider<F>
dev.wyck.factory.ConstructWireProvider<F>
- Type Parameters:
F- the type of the wired class
@NullMarked
@AsOf("2.4.1")
@Internal
public final class ConstructWireProvider<F>
extends WireProvider<F>
A
WireProvider that can instantiate the version-resolved class directly
through a matching constructor, without an intermediate factory.- Since:
- 2.4.0
-
Field Summary
Fields inherited from class WireProvider
factory -
Method Summary
Methods inherited from class WireProvider
construct, empty, get, getNew, isRegistered, resolveClass, setProvider
-
Method Details
-
create
Creates a new ConstructingWireProvider instance.- Type Parameters:
F- the type of the wired class- Parameters:
classNameTemplate- the class name template to use for loading the class- Returns:
- a new ConstructingWireProvider instance
-
construct
Instantiates the version-resolved class directly. The constructor whose parameters match the supplied arguments is resolved once per argument count and cached thereafter. Primitive parameters accept their boxed counterparts, andnullarguments match any non-primitive parameter.- Parameters:
args- the constructor arguments- Returns:
- a fresh instance of the resolved class
-