Package org.tensorics.core.util
Class Instantiators
- java.lang.Object
-
- org.tensorics.core.util.Instantiators
-
public final class Instantiators extends java.lang.Object
Contains utility methods which help to instantiate classes which follow certain conventions. The most common one is that e.g. a class provides a constructor with one argument of a certain type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Instantiators.OngoingInstantiatorCreation<T>
Part of a fluent API to create Instantiators with one arguments.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Instantiators.OngoingInstantiatorCreation<T>
instantiatorFor(java.lang.Class<T> instanceClass)
Starting point for fluent clauses to create instantiators for certain type of objects.
-
-
-
Method Detail
-
instantiatorFor
public static <T> Instantiators.OngoingInstantiatorCreation<T> instantiatorFor(java.lang.Class<T> instanceClass)
Starting point for fluent clauses to create instantiators for certain type of objects. A typical example for the creation of a certain type of object (Instance) with an argument of a certain type (Argument) could look like this:Instantiator<Argument, Instance> instantiator = instantiatorFor(Instance.class) .withArgumentType(Argument.class); Instance instance = instantiator.create(anArgument); // anArgument being of type Argument
- Parameters:
instanceClass
- the type of the objects to be created by the instantiator- Returns:
- an objects that provides methods for refinements of the instantiator
-
-